Yahoo JSONP Ajax Request Wrapped in callback function

前端 未结 5 2006
孤独总比滥情好
孤独总比滥情好 2020-12-06 21:38

I understand that I can make a crossdomain ajax call with jquery, .ajax, and jsonp. I am calling the yahoo stock quote api. Everything is working and the result is returning

5条回答
  •  醉话见心
    2020-12-06 22:33

    Here is how I got it to work:

    I used .ajax instead of .jsonp because you need to give the url parameters. You also need to define in your code the name of the Yahoo callback function. Here is a link explaining how to use Yahoo callback function with its web services.

    http://developer.yahoo.com/javascript/json.html#callbackparam

    Here is the code:

       
    

提交回复
热议问题