Bug Tracker

Ticket #2374: jquery-1.2.3-ie_ajax_patch.txt

File jquery-1.2.3-ie_ajax_patch.txt, 0.7 kB (added by edwardaa, 11 months ago)

ajax patch for IE6

Line 
1--- jquery/jquery-1.2.3.js  Wed Feb  6 13:23:17 2008
2+++ jquery/jquery-patched.js    Thu Feb 21 05:56:55 2008
3@@ -2838,9 +2838,16 @@
4    },
5 
6    httpData: function( r, type ) {
7+       var isIE = window.ActiveXObject ? true : false;
8        var ct = r.getResponseHeader("content-type");
9        var xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0;
10-       var data = xml ? r.responseXML : r.responseText;
11+       var data = xml ? (isIE ? r.responseText : r.responseXML) : r.responseText;
12+
13+       if (isIE) {
14+           var xmldom = new ActiveXObject('Microsoft.XMLDOM');
15+           xmldom.loadXML(r.responseText);
16+           data = xmldom;
17+       }
18 
19        if ( xml && data.documentElement.tagName == "parsererror" )
20            throw "parsererror";