2011-07-08 35 views

回答

0

我也不熟悉這一點。但他們的榜樣看起來你可以稱之爲以下列方式:

x$('#element_id).xhr('http://www.w3schools.com/webservices/tempconvert.asmx/CelsiusToFahrenheit', { 
    async: true, 
    method: 'post', 
    callback: function() { 
     alert("The response is " + this.responseText); 
    } 
}); 

,你將需要攝氏數據發送到API:

x$('#element_id).xhr('http://www.w3schools.com/webservices/tempconvert.asmx/CelsiusToFahrenheit', { 
    async: true, 
    data: 'Celsius=40', 
    method: 'post', 
    callback: function() { 
     alert("The response is " + this.responseText); 
    } 
});