XMLHttpRequest for "HEAD" dumps "no element found" errors
Michael Vincent van Rantwijk <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.xml |
|---|---|
| Organization | Another Netscape Collabra Server User |
| Message-ID | <[email protected]> |
I use somehing like this:
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("HEAD", aURL, false);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
return xmlhttp.getResponseHeader("Last-Modified");
}
}
xmlhttp.send(null);
and that works, but it throws JavaScript errors like this:
Error: [JavaScript Error: "no element found" {file:
"http://mozillazine.org/atom.xml" line: 1 column: 1 source: "
^"}]
Source File: http://mozillazine.org/atom.xml
Line: 1, Column: 1
Source Code:
^
Why is that?
Note that I looked for "no element found" and found this:
http://lxr.mozilla.org/seamonkey/search?string=no%20element%20found
but only the headers are send, not the file, so why does it spit out
this kind of XML parser errors?
Michael