problems on microsoft XMLDOM in Mozila

E

Eitan

Hello,
IE is fine,
but when I am using Mozila browser and do in javascript as follows :

var current_menu;
current_menu = new ActiveXObject("Microsoft.XMLDOM");

....
It works only for Internet Explorer.
For Mozila/Netscape/Fire-Fox - it is an error.

What can I do instead ?

Thanks :)
 
M

Martin Honnen

Eitan wrote:

but when I am using Mozila browser and do in javascript as follows :

var current_menu;
current_menu = new ActiveXObject("Microsoft.XMLDOM");

...
It works only for Internet Explorer.
For Mozila/Netscape/Fire-Fox - it is an error.

It really depends on what you want to do, if you want to create a DOM
document in memory you can do it as follows in Mozilla (and in the
upcoming Opera 7.6x):

var xmlDocument;
if (document.implementation &&
document.implementation.createDocument &&
(xmlDocument = document.implementation.createDocument('', 'gods',
null))) {
var god = xmlDocument.createElement('god');
god.appendChild(xmlDocument.createTextNode('Kibo'));
xmlDocument.documentElement.appendChild(god);
}

It should work with other browsers implementing the DOM Level 2 Core too.

If you want to load a document from a URL use XMLHttpRequest, example is
here:
http://www.faqts.com/knowledge_base/view.phtml/aid/17226/fid/616
 

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

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top