There are some threads with the similar question. Tried to read them. But dint get any satisfactory answer. I am trying to access this json file: http://www.fastel.se/emedius/products.json. I got the above error.
I understand that cross domain access is not allowed. I tried to use the jsonp.
Below is my code:
$.ajax({
type: "GET",
url: "http://www.fastel.se/emedius/products.json",
dataType: "jsonp",
jsonpCallback: 'callback',
success: function (data) {
var content = "";
for(property in data)
for(product in data[property])
content += Object.keys(data[property][product])[0] + ", ";
document.getElementById("main").innerHTML = content;
},
});
But I got this error: "Uncaught SyntaxError: Unexpected token :".
It appears this error is because the server doesn''t support jsonp requests.
Is there any possible way I can access this json file without doing any modifications on the server side?
Thanks for the answer.