蒸気に関するゲーム情報が必要です。私は、APIを見つけ、私はそれが言う使用する場合:jsonp Uncaught SyntaxError:予期しないトークン:
No 'Access-Control-Allow-Origin' header is present on the requested resource.
はまた、私は、JSON Pを使用するが、それはエラーをスローします:
Uncaught SyntaxError: Unexpected token :
私のコードは以下の通りです:
$.ajax({
//crossDomain: 'true',
url: 'http://store.steampowered.com/api/appdetails/?appids=730',
//url: 'http://api.steampowered.com/ISteamApps/GetAppList/v0001/',
//url:'http://store.steampowered.com/api/appdetails/?appids=730',
//url:'games.json',
type: 'get',
dataType:'jsonp',
//dataType:'json',
//data = JSON.parse(data);
crossDomain : true,
success:function(data){
console.log(data);
},
error:function(data){
console.log("Hata ",data);
}
});
私はanyorigin.comを使用しますが、動作しません。ローカルの.jsonファイルを使用すると動作しますが、スチームが必要です。