我想要一些使用jquery mobile调用json webservices的运行示例/教程。
我正在尝试开发我的第一个移动应用程序,但还没有找到一个有成效的例子。
谢谢,
发布于 2013-10-05 18:17:25
首先,我将查看官方文档中的示例:http://api.jquery.com/jQuery.getJSON/和http://api.jquery.com/jQuery.post/
这应该就是您需要的全部内容。
发布于 2013-10-06 06:46:51
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> });https://stackoverflow.com/questions/19196462
复制相似问题