Skip to content

Commit

Permalink
Fixes jashkenas#2152 -- support PATCH in IE <= 8
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Mar 19, 2013
1 parent 155bd06 commit f495c36
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions backbone.js
Original file line number Diff line number Diff line change
Expand Up @@ -1445,6 +1445,15 @@
params.processData = false;
}

// If we're sending a `PATCH` request, and we're in an old Internet Explorer
// that still has ActiveX enabled by default, override jQuery to use that
// for XHR instead. Remove this line when jQuery supports `PATCH` on IE8.
if (params.type === 'PATCH' && window.ActiveXObject) {
params.xhr = function() {
return new ActiveXObject("Microsoft.XMLHTTP");
};
}

// Make the request, allowing the user to override any Ajax options.
var xhr = options.xhr = Backbone.ajax(_.extend(params, options));
model.trigger('request', model, xhr, options);
Expand Down

0 comments on commit f495c36

Please sign in to comment.