janmeet / geoxml3

Automatically exported from code.google.com/p/geoxml3
0 stars 0 forks source link

Change request: use of local files. #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Due to Issue 10 XMLHttpRequest of IE denies access to local files; browsers
as Firefox, Chrome, Opera accept local files.
To make access to local files possible, i have changed geoXML3.fetchXML:

If the protocoll of the main page is file:// and ActiveXObject exists: use
of window.ActiveXObject("MSXML2.XMLHTTP.3.0")
otherwise: window.XMLHttpRequest

With this modification I found the following failures:
- xmlFetcher.timeout does not exist
  reason: an ActiveXObject object can not be augmented by the property timeout
- for local files ActiveXObject sets xhrFetcher.responseXML.documentElement
to null and the DOM is not loaded.
The xml file is stored in responseText.

So I load the DOM by 
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = false;
xmlDoc.loadXML(xhrFetcher.responseText);
callback(xmlDoc);

That works.

Original issue reported on code.google.com by osterman...@googlemail.com on 28 May 2010 at 2:11

GoogleCodeExporter commented 9 years ago
fixed in network_link branch.

Original comment by geocodezip on 22 Sep 2010 at 5:44