xml load and safari 3

A

Andrew Poulos

Using this code from quirksmode:

if (document.implementation && document.implementation.createDocument) {
xmlDoc = document.implementation.createDocument("", "", null);
xmlDoc.onload = fWriteList;
} else if (window.ActiveXObject) {
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.onreadystatechange = function () {
if (xmlDoc.readyState == 4) fWriteList();
};
} else {
alert("Your browser cannot display content.");
return;
}
xmlDoc.load("books.xml");//--> Safari doesn't like this line
};

doesn't return an error in IE, FF, and OP on Windows but Safari 3
complains that:
Value undefined (result of expression xmlDoc.load) is not object.

How can I get Safari to behave itself?

Andrew Poulos
 
M

Martin Honnen

Andrew said:
Using this code from quirksmode:

if (document.implementation && document.implementation.createDocument) {
xmlDoc = document.implementation.createDocument("", "", null);
xmlDoc.onload = fWriteList;
xmlDoc.load("books.xml");//--> Safari doesn't like this line
};

doesn't return an error in IE, FF, and OP on Windows but Safari 3
complains that:
Value undefined (result of expression xmlDoc.load) is not object.

How can I get Safari to behave itself?

The load method is not part of any W3C standard, it looks like Safari
does not implement it. You might want to use XMLHttpRequest instead to
load the XML document, then access the responseXML property to have an
XML DOM document.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top