How to call external webservice using jquery “jsonp”?

前端 未结 5 598
北恋
北恋 2020-12-20 00:51

I had a previous question can jquery ajax call external webservice?


and some good developers answered me to use jsonp, but i don\'t know how to use it, i am tr

5条回答
  •  情歌与酒
    2020-12-20 01:53

    I've had a similiar problem, unfortunately I don't have the code at hand.

    From memory:

    • Add [ScriptService] as an attribute to your Web Method
    • Also change your url to call the HelloWorld procedure.
      Something like http://localhost:1096/MySite/WebService.asmx/HelloWorld?callback

    See: What are some good examples of JQuery using JSONP talking to .net? & What is the best way to call a .net webservice using jquery?

提交回复
热议问题