Ticket #29: UrlLib-XmlHttpRequestFixForRecentOperaReleases.patch
| File UrlLib-XmlHttpRequestFixForRecentOperaReleases.patch, 2.0 kB (added by heldermagalhaes, 7 months ago) |
|---|
-
urllib.js
old new 151 151 try{ //to get MS HTTP request object 152 152 obj=new ActiveXObject("Msxml2.XMLHTTP.4.0"); 153 153 }catch(e){ 154 try{ //to get MS HTTP request object 154 try{ //to get MS HTTP request object 155 155 obj=new ActiveXObject("Msxml2.XMLHTTP"); 156 156 }catch(e){ 157 157 try{// to get the old MS HTTP request object … … 164 164 } 165 165 } 166 166 } 167 } 167 } 168 168 } 169 169 return obj; 170 170 }; … … 248 248 xmlhttp.onreadystatechange=function(){ 249 249 if (xmlhttp.readyState==4) { 250 250 callback(xmlhttp); 251 //xmlhttp.onreadystatechange = null; //help IE with garbage collection 252 xmlhttp = null; 251 //avoid this in Opera as it causes an issue 252 if(!window.opera){ 253 xmlhttp = null; //help IE with garbage collection 254 } 253 255 }else if (xmlhttp.readyState==2){ 254 256 //status property should be available (MS IXMLHTTPRequest documentation) 255 257 //in Mozilla it is not if the request failed(server not reachable) 256 258 //in IE it is not available at all ?! 259 //avoid this in Opera as it causes an exception 260 if(!window.opera){ 257 261 try{//see if it is mozilla otherwise don't care. 258 262 var isNetscape = netscape; 259 263 try{//if status is not available the request failed. 260 264 var s=xmlhttp.status; 261 265 }catch(e){//call the callback because Mozilla will not get to readystate 4 262 266 callback(xmlhttp); 263 xmlhttp = null;267 xmlhttp = null; //help IE with garbage collection 264 268 } 265 269 }catch(e){ 266 270
