If AJAX call was cancelled, because user navigated to a different page, error callbacks are not invoked.

This commit is contained in:
marcins78@gmail.com
2013-01-13 23:42:54 +00:00
parent ffb33dc978
commit 6d22dae608

View File

@@ -10,11 +10,13 @@ var GempLotrCommunication = Class.extend({
errorCheck:function (errorMap) {
var that = this;
return function (xhr, status, request) {
var errorStatus = "" + xhr.status;
if (errorMap != null && errorMap[errorStatus] != null)
errorMap[errorStatus](xhr, status, request);
else
that.failure(xhr, status, request);
if (xhr.getAllResponseHeaders()) {
var errorStatus = "" + xhr.status;
if (errorMap != null && errorMap[errorStatus] != null)
errorMap[errorStatus](xhr, status, request);
else
that.failure(xhr, status, request);
}
};
},