Is there something wrong with my JSON?
http://codepen.io/anon/pen/Ieyvl
var url = "http://x.com/json.js";
$.getJSON(url, function(response){
alert("worked!");
alert(response);
});
If its a “cross-domain” issue, then why does this work?
http://codepen.io/anon/pen/BHshC
var url = "http://gdata.youtube.com/feeds/api/playlists/PL3E245DF445E37F50?v=2&alt=jsonc";
$.getJSON(url, function(response){
alert("worked!");
alert(response);
});
Look at the console:
Read about the same origin policy.
You need to use JSONP if they support it. And if the server supports it look into CORS
[EDIT]
I did not check, but if the Google example works, it is probably because Google Enabled CORS for that resource. That mean browsers that support it can request the resource with an Ajax call. Not all browsers support that type of handshake request. [looking at you older IEs]