I\'m currently working through the book \"Head first HTML5 programming\". I want to load the content of a file named sales.json
from a web server on my own mach
I open html document with firefox
Your HTML document must be open with a URL in http://
, not file://
, if you want it to be able to open in javascript another document, unless the second document is served with relevant CORS headers.
This is due to same origin policy.
As you have a local WAMP server, there is no problem : simply open your file using a http://
URL like you do for your JSON file.