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); }); 

the network tab

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

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -