Skip to main content

Bug Tracker

Side navigation

Ticket #3087: custom-xhr.patch


File custom-xhr.patch, 1.3 KB (added by flesler, August 06, 2008 10:15PM UTC)

New proposition

Index: ajax.js
===================================================================
--- ajax.js	(revision 5806)
+++ ajax.js	(working copy)
@@ -113,14 +113,7 @@
 			dataType: type
 		});
 	},
-	
-	// Create the request object; Microsoft failed to properly
-	// implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
-	getAjaxTransport : function() {
-		return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
-	},
 
-
 	getScript: function( url, callback ) {
 		return jQuery.get(url, null, callback, "script");
 	},
@@ -159,6 +152,12 @@
 		data: null,
 		username: null,
 		password: null,
+		// Create the request object; Microsoft failed to properly
+		// implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
+		// This function can be overriden by calling jQuery.ajaxSetup
+		xhr:function(){
+			return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
+		},
 		accepts: {
 			xml: "application/xml, text/xml",
 			html: "text/html",
@@ -282,7 +281,7 @@
 		var requestDone = false;
 
 		// Create the request object
-		var xhr = jQuery.getAjaxTransport();
+		var xhr = s.xhr();
 
 		// Open the socket
 		// Passing null username, generates a login popup on Opera (#2865)

Download in other formats:

Original Format