A
alex bazan
I've got this piece of code that imports an XML document ... it works
for both mozilla and IE.
function getXMl(url) {
if (!document.all) {
var xmlDoc = document.implementation.createDocument('','doc',null);
var xmlHTTP = new XMLHttpRequest();
xmlHTTP.overrideMimeType("text/xml");
xmlHTTP.open("GET",url, false);
xmlHTTP.send(null);
xmlDoc=xmlHTTP.responseXML;
} else {
try {
xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
} catch (e) {
xmlDoc = new ActiveXObject("Msxml.DOMDocument");
}
xmlDoc.async="false";
xmlDoc.load(url);
}
return xmlDoc;
}
With mozilla i can use the same code to import an HTML file instead of
an XML file with no problems... but the object in IE expects a valid XML
file, so it does not work (xmlDoc.xml and xmlDoc.text gives me an
empty string output)...
Which is the object that will allow me to import an HTML file in IE?
thanks in advance.
alex.
for both mozilla and IE.
function getXMl(url) {
if (!document.all) {
var xmlDoc = document.implementation.createDocument('','doc',null);
var xmlHTTP = new XMLHttpRequest();
xmlHTTP.overrideMimeType("text/xml");
xmlHTTP.open("GET",url, false);
xmlHTTP.send(null);
xmlDoc=xmlHTTP.responseXML;
} else {
try {
xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
} catch (e) {
xmlDoc = new ActiveXObject("Msxml.DOMDocument");
}
xmlDoc.async="false";
xmlDoc.load(url);
}
return xmlDoc;
}
With mozilla i can use the same code to import an HTML file instead of
an XML file with no problems... but the object in IE expects a valid XML
file, so it does not work (xmlDoc.xml and xmlDoc.text gives me an
empty string output)...
Which is the object that will allow me to import an HTML file in IE?
thanks in advance.
alex.