try the various xhr loading techniques
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 6 Mar 2009 03:45:32 +0000 (03:45 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 6 Mar 2009 03:45:32 +0000 (03:45 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1673 9efc2488-bf62-4759-914b-345cdb29e865

src/javascript/opensrf_xhr.js

index 76d8473..8cace89 100644 (file)
@@ -27,7 +27,16 @@ var OSRF_POST_CONTENT_TYPE = 'application/x-www-form-urlencoded';
 OpenSRF.XHRequest = function(osrf_msg, args) {
     this.message = osrf_msg;
     this.args = args;
 OpenSRF.XHRequest = function(osrf_msg, args) {
     this.message = osrf_msg;
     this.args = args;
-    this.xreq = new XMLHttpRequest(); /* XXX browser check */
+    try {
+           this.xreq =  new XMLHttpRequest();
+    } catch(e) {
+           try { 
+                   this.xreq = new ActiveXObject("Msxml2.XMLHTTP"); 
+           } catch (e2) {
+                       this.xreq = new ActiveXObject("Microsoft.XMLHTTP"); 
+           }
+    }
+
 }
 
 OpenSRF.XHRequest.prototype.send = function() {
 }
 
 OpenSRF.XHRequest.prototype.send = function() {