我在这里只找到了一个使用xui.js调用web服务的示例:http://wiki.phonegap.com/w/page/32513809/Simple-Web-Service-Consumption-with-PhoneGap-and-XUI
但这一点还不清楚。例如,如何调用此web方法?:http://www.w3schools.com/webservices/tempconvert.asmx?op=CelsiusToFahrenheit
发布于 2011-07-10 18:42:03
我对此也不熟悉。但是他们的例子看起来你可以用下面的方式来调用它:
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);
}
});https://stackoverflow.com/questions/6623438
复制相似问题