Login Register

Mozilla

dojo.xhrGet and local XML files in Mozilla

I am trying to use dojo.xhrGet to load an XML file when all my pages are loaded from the local filesystem (not on a server). The file contains valid XML but does not have an XML extension (let's say it's xml_data.dat).

Because it's a local file, no http headers are used to set the content/mime type as it looks like Mozilla (Firefox 2 and Seamonkey) is trying to guess the mime type by file extension. That fails and I only get a responseText in the xhr.

I got around it by using XMLHttpRequest.overrideMimeType() method available in Mozilla browsers.

Syndicate content