Browse files

Avoid setting withCredentials to null. Fixes #295. Fixes #279.

  • Loading branch information...
1 parent b6dae4e commit b1c482f55c8674168720c1f886af63799f7eb809 @ebeigarts ebeigarts committed Jan 3, 2013
Showing with 9 additions and 3 deletions.
  1. +9 −3 src/rails.js
View
12 src/rails.js
@@ -164,11 +164,17 @@
error: function(xhr, status, error) {
element.trigger('ajax:error', [xhr, status, error]);
},
- xhrFields: {
- withCredentials: withCredentials
- },
crossDomain: crossDomain
};
+
+ // There is no withCredentials for IE6-8 when
+ // "Enable native XMLHTTP support" is disabled
+ if (withCredentials) {
+ options.xhrFields = {
+ withCredentials: withCredentials
+ };
+ }
+
// Only pass url to `ajax` options if not blank
if (url) { options.url = url; }

0 comments on commit b1c482f

Please sign in to comment.