0
我想問一些使用jquery移動調用json webservices的運行示例/教程。使用jQuery移動調用Webservice
我試圖開發我的第一個移動應用程序,但無法找到一個富有成效的例子。
謝謝
我想問一些使用jquery移動調用json webservices的運行示例/教程。使用jQuery移動調用Webservice
我試圖開發我的第一個移動應用程序,但無法找到一個富有成效的例子。
謝謝
首先我會檢查出的官方文檔中的例子:http://api.jquery.com/jQuery.getJSON/和http://api.jquery.com/jQuery.post/
這應該是你所需要的。
var serviceUrl = 'http://' + _SERVER_ADDRESS + '/YOURSERVICE.svc/' + method;
var jsonCallbackMethod = 'spycallback49328572';
$.ajax({
type : "GET",
url : serviceUrl,
jsonpCallback : jsonCallbackMethod,
data : params,
dataType : 'jsonp',
timeout : 11*1000 // Necessary in order to detect not found(404) error
})
.done(function(response) { <success code> })
.fail(function(xhr) { <failure code> });