SOP ile kısıtlanacaksınız (XMLHttpRequest
s sadece URI'nin aynı etki alanında yapılabilir; JSON yalnızca bu yöntemle alınabilir). Bunu atlamak için JSONP instead (other explanation*) kullanmanız gerekir. Yapabileceğiniz böylece
Bu son nokta supports JSONP görünüyor:
function foo(response) {
// response is already a JavaScript object
}
var script = document.createElement("script");
script.src = "http://search.twitter.com/search.json?q=bacon&callback=foo";
document.body.appendChild(script);
* Yasal Uyarı: http: // stackoverflow Evet, bu size yardımcı olacaktır Olabilir blogumu
bu. com/questions/2499567/nasıl yapılır-yapmak-a-json-call-to-a-url –