SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: XmlDocument

  1. #1
    SitePoint Guru Galo's Avatar
    Join Date
    May 2005
    Location
    Holland!
    Posts
    852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    XmlDocument

    Hi,

    I need some help solving this, google and the search did nothing,..

    i implemented an xml reference through :

    <xml id="agendaXML" src="../xml/agenda.xml" />

    i implemented a method : getAgenda();

    Code:
    function getAgenda(){
       
       
       var sDisplay = "";
       var oXmlDom;
       
       if (document.all) {
       
           oXmlDom = document.all("agendaXML").XMLDocument;
       
        } else {
        
            oXmlDom = document.getElementById("agendaXML").XMLDocument;
        }
      
       alert(oXmlDom);
    }
    Can somebody please explain me why i get a undifined object in FireFox but the object is there when i run it on IE ?

    thanks in advance
    Business as usual is off the menu folks, ...

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    xml parsing

    The Firefox browser has a different XML parser than IE has (note the script gymnastics involved with writing cross-browser AJAX code).
    You may be able to do what you have now for IE, and use the XMLSerializer object for Mozilla. http://www.webdeveloper.com/forum/sh...d.php?t=121847
    In any case, you should be able to find something helpful at
    http://developer.mozilla.org/en/docs/

  3. #3
    SitePoint Guru Galo's Avatar
    Join Date
    May 2005
    Location
    Holland!
    Posts
    852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks alot i fixed it, however another problem has come to me, i positioned the div i want to chenge the innerHTML from within a table, now IE does not find the id anymore, and when i put the same div tag to the top of the page just underneath thebody tag it does work,... whatz this about then ?
    Business as usual is off the menu folks, ...

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    browser DOMs

    The browsers have different DOMs too. IE adds a tbody to tables if you don't have one and this can "add a generation/branch)" to the DOM. But if you're using Id I would think it should work.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •