refactor(load) ajax: Events.add -> xhr.onreadystatechange

This commit is contained in:
coderaiser 2016-03-05 04:55:29 -05:00
parent 4e7a211b75
commit 995860b963

View file

@ -189,12 +189,12 @@
else
data = p.data;
Events.add('readystatechange', xhr, function(event) {
xhr.onreadystatechange = function(event) {
var TYPE_JSON, type, data, isContain, notText,
xhr = event.target,
OK = 200;
if (xhr.readyState === 4 /* Complete */) {
if (xhr.readyState === xhr.DONE) {
Images.clearProgress();
TYPE_JSON = 'application/json';
type = xhr.getResponseHeader('content-type');
@ -212,7 +212,7 @@
Util.exec(p.success, data, xhr.statusText, xhr);
}
}
});
};
xhr.send(data);
};