I hope you are well. I am working on a project that involves working with the Steam Web API in angular JS. I am trying to fetch the data from this URL:
http://api.steampowered.com/ISteamApps/GetAppList/v2
When I run my code in Google Chrome it shows:
Uncaught SyntaxError: Unexpected token :
I know that there's this issue with CORS(and some sites not playing nice with it so I am trying to work around that using JSONP. Is there something that I am missing or doing wrong?
Kind regards,
Adi
Here's the relevant snippets of code (I have excluded my API Key per the Steam Web API terms):
var steam_api = "https://api.steampowered.com/ISteamApps/GetAppList/v2";
steam_api += "?key=mySteamKey";
steam_api += "&format=json&callback=JSON_CALLBACK";
$scope.steamGames = {};
$http.jsonp(steam_api)
.success(function(data, status, headers, config){
console.log(data);
$scope.steamGames = JSON.parse($scope.rawData);
$scope.steamSearch = document.getElementById('Search').value;
});
Edit: Just for clarity I have also checked with a JSON validator and the JSON that it spews out is valid.