开发者

JQuery getJSON callback not executing

开发者 https://www.devze.com 2023-03-05 11:29 出处:网络
It\'s been a while since I\'ve worked front-end, and I seem to have forgotten it all. I cannot get this call to the bing API to work, or even do anything . . .

It's been a while since I've worked front-end, and I seem to have forgotten it all. I cannot get this call to the bing API to work, or even do anything . . .

 $( document ).ready( function() {
     $.getJSON( 'http://api.search.live.开发者_JS百科net/json.aspx?Appid=**my app id**6&query=sushi&sources=web', function( data ) {
         alert ( 'BAM!' );
     } );
 } );

I've looked at other SO questions but haven't found anything that works. The error log shows nothing. The ready function is executing, I tested that, but the getJSON callback never executes.

Is it possible the bing api is returning a malformed json?


You need a jsonp-response for cross-domain-requests. Take a look at this: Bing search API using Jsonp not working, invalid label

0

精彩评论

暂无评论...
验证码 换一张
取 消