I'm trying to request a json file through AJAX (jQuery) from NBA.com
I tried first getting the json file but got a CORS error so I tried using jsonp
This returns me an object but the object looks like it's full of functions and methods instead of the data I requested.
I made this on codepen so you can check it out, output can be checked with developer console because document.write just returns [object Object]
here is the link to codepen: http://codepen.io/kyriediculous/pen/KNKZZL
$(document).ready(function() {
function getPlayerGameLogs() {
$.ajax ({
url: "http://stats.nba.com/stats/commonplayerinfo?LeagueID=00&PlayerID=202355&SeasonType=Regular+Season&format=jsonp",
dataType:"jsonp",
success: function(response) {
console.log(response);
}
})
};
getPlayerGameLogs();
});
Could someone explain this a bit ? Is it impossible to request the JSONs from nba.com? Specifically the game logs for every player.