jquery - Unexpected token when doing remote json call -
i've searched everywhere can't solve problem:
when copy content of json file locally works (without callback=?)
however when crossdomain call following error in console:
uncaught syntaxerror: unexpected token :
this code:
var url='http://www.motor-forum.nl/json.php?type=json&callback=?'; $.getjson(url,function(json){ $.each(json.globals, function(i,data){ $("#results").html(data.board_reactid); }); });
hopefully can me out here
i've tried api - not support jsonp. getting stuff remote servers isn't simple going &callback=?
on urls - remote server needs openly support it.
jsonp works across cross-domain restrictions loading return in script tag. means object must evaluable script. jsonp, user provides callback name in url, , return json object wrapped in function call (mycallbackname({object});
).
Comments
Post a Comment