Thursday, February 26, 2015

Switch HTTP request object for browser compatability

 function GetRequestObject() {  
   if (window.XMLHttpRequest) {  
     return new window.XMLHttpRequest;  
   } else {  
     try {  
       return new ActiveXObject("MSXML2.XMLHTTP.3.0");  
     }  
     catch (ex) {  
       return null;  
     }  
   }  
 }  

No comments:

Post a Comment