I have a JSON file here:
http://dalexl.webs.com/products.json
I'm trying to read it on my site with Javascript/jQuery:
$.getJSON("http://dalexl.webs.com/products.json")
(Yes, I know that it isn't complete, I'm currently just trying to get it to load, I haven't worked on reading it yet)
I tried having in my own sites directory (I'm using Dreamweaver locally on my HD).
$.getJSON("json/products.json")
The problem is, in Chrome (I'm not sure about other browsers), the console gives me this error:
XMLHttpRequest cannot load http://dalexl.webs.com/products.json. Origin null is not allowed by Access-Control-Allow-Origin.
or:
XMLHttpRequest cannot load json/products.json. Origin null is not allowed by Access-Control-Allow-Origin.
At first, reading about the problem online suggested that it was Chrome thinking that a website was trying to read files on my computer. After moving the file online, however, the problem continues.
Does anybody have a solution to this? If it isn't supposed to be supported, why does jQuery have a native method of doing it?
Thanks!