I have a problem to get json.
If I use:
$.getJSON("file:///E:/WebProject/json/"+name+".json",resolve)
It works!
But if I use:
$.getJSON("/json/"+name+".json",resolve)
It does not work. Why?
I have a problem to get json.
If I use:
$.getJSON("file:///E:/WebProject/json/"+name+".json",resolve)
It works!
But if I use:
$.getJSON("/json/"+name+".json",resolve)
It does not work. Why?
Try Changing
$.getJSON("/json/"+name+".json",resolve)
to
$.getJSON("json/"+name+".json",resolve)
/json looks for the file in the root but I think json folder is in your web folder, not in the root.
When the first character is /, the browser fetch the file from the root of the site address
e.g.
file:///E:/WebProject + /json/name.json = file:///E:/json/name.json (maybe even without the E letter)
otherwise, the addition is relative:
file:///E:/WebProject + json/name.json = file:///E:/WebProject/json/name.json
/ and you should be finepython -m SimpleHTTPServer