HTML and CSS Reference
In-Depth Information
This way, the browser will use whatever protocol the page has been served with for
the request. You can learn more about protocol-relative URLs in the Appendix sec-
Of course, this means if you are testing locally, and if you view your page on the
browser, the browser will use a URL that looks like file://users/divya/pro-
jects, and hence the browser will attempt to look for a jQuery file using the follow-
ing URL:
This request will definitely fail, as there is no resource locally at that path. Hence, if
you are using protocol-relative URLs, you need to set up a local server to test your
files. This is easily done on a Mac or Unix-based OS by navigating to your project
folder in your shell interface and executing the following command:
python -m SimpleHTTPServer
This will start a server and your project's index.html file will be available on ht-
tp://localhost:8000 .
If you are on Windows, copy the Mongoose executable (the latest version at the
time of writing was mongoose-3.3.exe ) from
goose/ to your project folder and launch it. Your project's index.html will then
be available at http://localhost:8080 .
Search WWH ::

Custom Search