Wednesday, March 20, 2019

jquery - How to access json file via chrome

I have a local json file in my web directory and want to access it.
I currently use $.getJSON() from jquery and it works fine with all browsers but chrome.



How can I access this file via chrome?




Code:







Edit: totaly forgot to paste the chrome console error here:




Access to XMLHttpRequest at
'file:///C:/Users/Sirzento/Desktop/website/JsonData.json' from origin
'null' has been blocked by CORS policy: Cross origin requests are only
supported for protocol schemes: http, data, chrome, chrome-extension,
https.



No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...