[OpenLayers-Dev] Suggested change to XMLHttpRequest.js. Works for IE, FF, Safari, Chrome 4

Phil Scadden p.scadden at gns.cri.nz
Wed Apr 21 01:11:47 EDT 2010

This is a revisit of the question for getting openlayers to work in all 
browsers off content in a local USB.

Change the function cXMLHttpRequest() to this.
     function cXMLHttpRequest() {
         this._object    = oXMLHttpRequest && (window.location.protocol 
!== "file:" || !window.ActiveXObject) ?
                 new oXMLHttpRequest
              :  new window.ActiveXObject("Microsoft.XMLHTTP");


Tried it in 2.8 and 2.9 rc3, and with all 4 browsers. Got local files 
serving up fine as well as wms content
from off the web in the same map.
Phil Scadden, Senior Scientist GNS Science Ltd 764 Cumberland St, 
Private Bag 1930, Dunedin, New Zealand Ph +64 3 4799663, fax +64 3 477 5232

Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.

More information about the Dev mailing list