Bug Tracker

Ticket #3087: ajax_transport.diff

File ajax_transport.diff, 1.0 KB (added by choan, 14 years ago)

Makes the Ajax transport replaceable

  • src/ajax.js

     
    9797var jsc = now();
    9898
    9999jQuery.extend({
     100 
     101  // Create the request object; Microsoft failed to properly
     102        // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
     103  getAjaxTransport : function() {
     104    return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
     105  },
     106 
    100107        get: function( url, data, callback, type ) {
    101108                // shift arguments if data argument was ommited
    102109                if ( jQuery.isFunction( data ) ) {
     
    275282
    276283                // Create the request object; Microsoft failed to properly
    277284                // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
    278                 var xhr = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
     285                var xhr = jQuery.getAjaxTransport();
    279286
    280287                // Open the socket
    281288                // Passing null username, generates a login popup on Opera (#2865)