Skip to content

Instantly share code, notes, and snippets.

@fjakobs
Created January 6, 2011 12:29
Show Gist options
  • Save fjakobs/767829 to your computer and use it in GitHub Desktop.
Save fjakobs/767829 to your computer and use it in GitHub Desktop.
xhr multipart patch
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