Why does the following fail:
var url = "http://www.nfl.com/liveupdate/game-center/2012080953/2012080953_gtd.json"; $.getJSON(url, function(json){ $("#jsondata").text(json); }).fail(function(error){ $("#jsondata").text("fail: " + JSON.stringify(error, null, 4)); }); Here is the output: fail: { "readyState": 0, "status": 0, "statusText": "error" }
I json linted the url and it's valid. I just don't get it. I've used $.getJSON plenty without issues. I just can't seem to find the working solution to this. Is it the .json extension?
XMLHttpRequest cannot load http://www.nfl.com/liveupdate/game-center/2012080953/2012080953_gtd.json?_=1424830190095. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://stackoverflow.com' is therefore not allowed access.Looks like nfl.com is smart and doesn't allow other sites to access their JSON.python != javascript, and i'm not familiar enough to know if I need server side code to access. Maybe?