我已将 phonegap 项目复制到类固醇,但现在我的 ajax 命令无法工作,我完全不知道是什么原因造成的,所以任何建议都可能会有所帮助。
这是导致问题的代码,它总是在 request.status = 0 时终止错误:
$.ajax({
type: "POST",
url: serverUrl + "login.ajax",
data: { jsonLogin: JSON.stringify(loginObject), deviceInfo: JSON.stringify(deviceInfo)},
async: true,
timeout: 7000,
cache: false,
headers: { "cache-control": "no-cache" },
success: function(data) {
...
},
error: function(request, status, err) {
...
},
complete: function(){...}
});