45
rated 0 times
[
47]
[
2]
/ answers: 1 / hits: 26448
/ 13 Years ago, fri, december 16, 2011, 12:00:00
I am desperately trying to get a local build of a site to get a JSON file (also local) with no luck. The exact code worked perfect on my server, but once local, breaks.
I get the JSON with jQuery like so:
$.getJSON(
lib/js/app.json,
function(data){
$.each(data, function(i,user){
+'<img src='+user.thumbnail+'/>
});
}
);
And receive this console error:
XMLHttpRequest cannot load file://localhost/Users/blakestruhs/new/lib/js/app.json. Origin null is not allowed by Access-Control-Allow-Origin.
I'm dying for an answer here. Please help me.
More From » jquery