JQuery getJSON callback not executing
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
精彩评论