Jörn Zaefferer schrieb:
> Hi folks,
>
> is there any way to set a header (ie. content-type: text/xml) when
> loading a file from a local disk, without a webserver? This would be a
> great help to run AJAX tests. I once read that someone implemented a
> kind of webserver via javascript (running inside a browser). Maybe
> someone has an idea how to proxy a load from disk to be able to set a
> content-type header...
>
> -- Jörn
Jörn, not sure if that helps at all, but you can load an xml file from
the local file system like this (Mozilla and IE):
XML.loadAsync = function(url, callback) {
var xmldoc = XML.newDocument();
if (document.implementation &&
document.implementation.createDocument) {
xmldoc.onload = function() { callback(xmldoc); };
} else {
xmldoc.onreadystatechange = function() {
if (xmldoc.readyState == 4) callback(xmldoc);
}
}
xmldoc.load(url)
}
Thanks to David Flanagan and my new JavaScript bible :-)
-- Klaus
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/