diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2007-04-03 21:19:54 +0000 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2007-04-03 21:19:54 +0000 |
commit | bfe5f891068af9f86d7be288ad0da7b442427d9c (patch) | |
tree | 42ce6092fa65617aa03f3cddcb7929c48d49c2cc /src/ajax | |
parent | 14fa1e858c91cbb354009bc68fbd893ed4ff540c (diff) | |
download | jquery-bfe5f891068af9f86d7be288ad0da7b442427d9c.tar.gz jquery-bfe5f891068af9f86d7be288ad0da7b442427d9c.zip |
Remove XMLHttpRequest shadowing, instead decide at runtime whether to create an ActiveXObject or the XMLHttpRequest, potentially fixing #963
Diffstat (limited to 'src/ajax')
-rw-r--r-- | src/ajax/ajax.js | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/ajax/ajax.js b/src/ajax/ajax.js index 9042a48d5..9c9a5df36 100644 --- a/src/ajax/ajax.js +++ b/src/ajax/ajax.js @@ -132,12 +132,6 @@ jQuery.fn.extend({ }); -// If IE is used, create a wrapper for the XMLHttpRequest object -if ( !window.XMLHttpRequest ) - XMLHttpRequest = function(){ - return new ActiveXObject("Microsoft.XMLHTTP"); - }; - // Attach a bunch of functions for handling common AJAX events /** @@ -624,8 +618,9 @@ jQuery.extend({ var requestDone = false; - // Create the request object - var xml = new XMLHttpRequest(); + // Create the request object; Microsoft failed to properly + // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available + var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); // Open the socket xml.open(s.type, s.url, s.async); |