Created
January 6, 2011 12:29
-
-
Save fjakobs/767829 to your computer and use it in GitHub Desktop.
xhr multipart patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
XHRMultipart.prototype._get = function(){ | |
var self = this; | |
this._xhr = this._request('', 'GET', true); | |
- this._xhr.onreadystatechange = function(){ | |
- if (self._xhr.readyState == 3) self._onData(self._xhr.responseText); | |
- }; | |
+ if ("onload" in this._xhr) { | |
+ this._xhr.onload = function() { | |
+ self._onData(self._xhr.responseText); | |
+ } | |
+ } else { | |
+ this._xhr.onreadystatechange = function(){ | |
+ if (self._xhr.readyState == 3) self._onData(self._xhr.responseText); | |
+ }; | |
+ } | |
this._xhr.send(null); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment