This is an old post but...
You can reference the working directory (the folder the .html file is located in) with ./
, and the directory above that with ../
Example directory structure:
/html/public/
- index.html
- script2.js
- js/
- script.js
To load script.js from inside index.html:
<script type="text/javascript" src="./js/script.js">
This goes to the current working directory (location of index.html) and then to the js folder, and then finds the script.
You could also specify ../
to go one directory above the working directory, to load things from there. But that is unusual.