I would like to call script and css from site root.
- I have a dev environment using wamp so my route is
localhost/mysite/js/script.js. - My prod environment will be
mysite/js/script.js.
I would like to call script from root, what should be the route if I'm not in the root folder and don't want to use ../?
The reason for that is I imagine a much more complex arborescence and I want to avoid excessive ../../../../[...] and I'm wondering if there is something for this.
Let's say I've a page in pages/contact.html and I want to call scripts/contact.js
- If I call
scripts/contact.js: 404 because I'm in thepagesfolder. - If I call
/scripts/contact.js: It will work inmysite.combut won't in local because I need to call/mysite/scripts/contact.js.
Thanks for your help.