:1 is being appended to my ajax requests with jQuery

限于喜欢 提交于 2019-12-13 07:08:57

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!