javascript - Can not fetch json content from remote web address -
i trying fetch data http://status.mojang.com/check not getting data back. getting data in response tab (google chrome)
i running on webserver test , tried local.
this code:
$.getjson("//status.mojang.com/check?jsoncallback=?", function(result) { console.log(result); });
any appreciated
according jquery page (http://api.jquery.com/jquery.getjson/),
this shorthand ajax function, equivalent to: $.ajax({ datatype: "json", url: url, data: data, success: success });
as accessing external url, you'll need send request jsonp call in order around access-control-allow-origin headers. means datatype
needs "jsonp"
Comments
Post a Comment