I use jQuery 1.2.6 (legacy).
In my general configuration I have set these options:
jQuery(document).ajaxStart(blockUI).ajaxStop(jQuery.unblockUI);
I have an ajax function that gets a javascript file:
function initWebtrends() {
console.debug("initWebtrends start");
var options = {
url : "ajax/myjavascript.js",
success: function(data) {
console.debug("webtrends integration successfully done...");
},
error:function(msg) {
console.debug("error contacting webtrends client component...");
}
};
jQuery.ajax(options);
console.debug("initWebtrends stop");
}
All works great when the ajax get response correctly: the ajaxStart and the ajaxStop events are triggered. But when I got a 404 error the error callback function is not called neither the ajaxStop event: in this case I do not receive any error but my page remains freeze since the ajaxStart is triggered and the blockUI function is executed.
Is there a way to handle this kind of situation? I know that on jquery 1.5 there's the statusCode option, but I have to make it work on my legacy version.
Kind regards
Massimo
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)