siaw23 siaw23 - 1 year ago 72
HTML Question

Referencing a parent directory in HTML

As far as references to directories are concerned, I understand

./ = current
../ = parent

But I am having a problem referencing my
directory in this bit of HTML code. The reference to the
folder works fine but not
. What am I missing?


<!DOCTYPE html>
<script src="lib/jquery/dist/jquery.min.js"></script>
<script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>

Directory structure looks like this:
enter image description here

Answer Source

Try going to <your server>/bower_components/bootstrap/dist/js/bootstrap.min.js

It probably won't work. If your server setup is normal only public and the folders below it are accessible from the client side. From the client point of view public is the root, there is nothing above that.

As for importing bootstrap, see if you can browse what node is making available in your browser. It's probably hosting the scripts you need to reference on the client side at another url. You might also find the url in the bower documentation/examples.

You could solve this by copying or symlinking the scripts into the public directory, but that would be a bit hackish, save it for if you get completly fed up with finding the intended way.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download