2011-07-02 20 views

回答

1

如何「與REST Web服務企業混搭和jQuery」在頁面加載一個Ajax調用?它包含代碼細節以及它如何工作的解釋。

Part 1

Part 2

0

這取決於你使用的後端技術,但使用jQuery一個通用的解決方案將使用$.ajax

$.ajax({ 
    type:'post', //Could be 'get' depending on your needs 
    url:'http://yoursite.com/yourwebservice', 
    dataType: 'xml', 
    success:function(data) { 
    //Here you have 'data' as xml. 
    //You can process 'data' here 
    } 
}); 

希望這有助於。乾杯

+0

什麼是網絡服務..有沒有我可以參考的演示?我對寧靜的網絡服務非常新穎 - 謝謝 – user244394

0

一個例子

這將使得.NET Web服務

$(document).ready(function() { 
    $.ajax({ 
    type: "POST", 
    url: "RSSReader.asmx/GetRSSReader", 
    data: "{}", 
    contentType: "application/json; charset=utf-8", 
    dataType: "json", 
    success: function(msg) { 
     //the result will be in msg 
    } 
    }); 
});