开发者

Call Webservice from HTML Page

开发者 https://www.devze.com 2022-12-14 11:46 出处:网络
How 开发者_StackOverflow社区we can call webservice from html page using javascript Because of same origin restrictions, you might need to use JSONP through script injection.

How 开发者_StackOverflow社区we can call webservice from html page using javascript


  1. Because of same origin restrictions, you might need to use JSONP through script injection.

  2. Of course if you are talking a Web Service on the same origin, just use AJAX.

  3. Through an web browser extension


using jQuery:

$.ajax({ 
    type: "POST", 
    contentType: "application/json; charset=utf-8", 
    url: "WebService.asmx/WebMethodName", 
    data: "{}", 
    dataType: "json"
});
0

精彩评论

暂无评论...
验证码 换一张
取 消