问题
I'm trying to access an external API from my website, and for some strange reason I am getting an ':1' appended to my ajax requests. Everything else seems to be right. BTW, I'm trying to access the Bing Images API using jQuery.
$.get('http://api.bing.net/json.aspx?callback=?',
{
AppId : <MYAPPID>,
Query : 'help',
Sources : 'Image'
},
imageResponseHandler,
'json'
);
I get this URL, which throws a syntax error in chrome console:
http://api.bing.net/json.aspx?callback=jsonp1329103936801&AppId<myappid>&Query=help&Sources=Image:1
The ':1' at the end brings up a 'not expecting token :' error. Where is it coming from? Removing the colon and pasting the url into my browsers gets me the json I want, but this seems to break before actually making the request.
Thanks, Siegfried
来源:https://stackoverflow.com/questions/9255270/1-is-being-appended-to-my-ajax-requests-with-jquery