0
嗨,大家好我正在使用PhoneGap 1.5.0与jQuery 1.6.4和jQuery Mobile 1.0.1,并且正在尝试为xml文件做一个简单的ajax调用。它在成功时一切正常,但如果我将URL或凭据更改为无效值,则不会调用错误方法。jquery ajax调用不会触发错误回调
$
.ajax({
url : "url be here",
dataType : "xml",
contentType : 'application/xml',
username : username,
password : password,
success : function(xmlData, textStatus, xhr) {
//this is triggered on success
},
error : function(XMLHttpRequest, textStatus, errorThrown) {
//this is never called
}
});
我弄不明白,我在做什么错在这里。 :(
作品,而不是与错误的凭据。如果我手动设置Ajax调用超时(超时:15000)。错误回调在这两种情况下都会触发(错误的IP和错误的凭证)。感觉不正确,但现在“有效”... – Redfox 2012-03-12 12:50:25