problems on microsoft XMLDOM in Mozila

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eitan

    problems on microsoft XMLDOM in Mozila

    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.XMLDO M");

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

    What can I do instead ?

    Thanks :)


  • Martin Honnen

    #2
    Re: problems on microsoft XMLDOM in Mozila



    Eitan wrote:

    [color=blue]
    > but when I am using Mozila browser and do in javascript as follows :
    >
    > var current_menu;
    > current_menu = new ActiveXObject(" Microsoft.XMLDO M");
    >
    > ...
    > It works only for Internet Explorer.
    > For Mozila/Netscape/Fire-Fox - it is an error.[/color]

    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.imple mentation &&
    document.implem entation.create Document &&
    (xmlDocument = document.implem entation.create Document('', 'gods',
    null))) {
    var god = xmlDocument.cre ateElement('god ');
    god.appendChild (xmlDocument.cr eateTextNode('K ibo'));
    xmlDocument.doc umentElement.ap pendChild(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:


    --

    Martin Honnen

    Comment

    Working...