- absolute path
- rootrelative path
- document-relative path
All three indicate where a web browser can find a particular file. An absolute path is like a postal address–it contains all the information needed for a web browser located anywhere in the world to find the file. An absolute path includes http://, the hostname, and the folder and name of the file. For example: http://www.mojodigitalsolutions.com/scripts/site.js. A root-relative path indicates where a file is located relative to a site’s top-level folder–the site’s root folder. A root-relative path doesn’t include http:// or the domain name. It begins with a / (slash) indicating the site’s root folder–the folder the home page is in. For example, /scripts/site.js indicates that the file site.js is located inside a folder named scripts, which is itself located in the site’s top-level folder. An easy way to create a root-relative path is to take an absolute path and strip off the http:// and the host name. For example, http://www.mojodigitalsolutions.com/index.html written as a root-relative URL is just /index.html.
be different; ../scripts/site.js–the ../ means climb up out of the about folder, while the /scripts/site.js means go to the scripts folder and get the file site.js.
Here are some tips on which URL type to use:
- If you’re pointing to a file that’s not on the same server as the web page, you must use an absolute path. It’s the only type that can point to another website.
you’re just opening a web page off your computer using the browser’s File→ Open command, the web browser