我不时编码并制作脚本以获得乐趣并帮助他人。如何从其他站点获取JSON?我们知道,存在跨域限制..这就是我想要获得的:http://steamcommunity.com/market/priceoverview/?appid=730¤cy=3&market_hash_name=StatTrak%E2%84%A2%20M4A1-S%20|%20Hyper%20Beast%20(Minimal%20Wear)。我试过这个:
$.ajax({
url: 'https://jsonp.afeld.me/?url=http://steamcommunity.com/market/priceoverview/?appid=730¤cy=3&market_hash_name=StatTrak%E2%84%A2%20M4A1-S%20|%20Hyper%20Beast%20(Minimal%20Wear)',
type: 'GET',
dataType: 'jsonp',
success: function(data) {
console.log(data);
}
});
我真的很感谢你的帮助。谢谢! :)