Commit 35c74509 authored by Wandenberg's avatar Wandenberg

fix callbacks calls on crossdomain requests for IE

parent d512497f
......@@ -237,6 +237,17 @@ Authors: Wandenberg Peixoto <wandenberg@gmail.com>, Rogério Carvalho Schneider
settings.xhr = xhr;
if (window.XDomainRequest && (xhr instanceof window.XDomainRequest)) {
xhr.onload = function () {
if (settings.afterReceive) { settings.afterReceive(xhr); }
if (settings.success) { settings.success(xhr.responseText); }
};
xhr.onerror = xhr.ontimeout = function () {
if (settings.afterReceive) { settings.afterReceive(xhr); }
if (settings.error) { settings.error(xhr.status); }
};
} else {
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
Ajax.clear(settings);
......@@ -248,6 +259,7 @@ Authors: Wandenberg Peixoto <wandenberg@gmail.com>, Rogério Carvalho Schneider
}
}
};
}
if (settings.beforeOpen) { settings.beforeOpen(xhr); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment