Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS how to display the xml data in html div tag

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #35638
    vithra
    Member

    hi

    i tried to put a xml data in html div tag using javascript. it was worked in mozila but in IE and chrome it dosen’t work can any one tell me a suggestion to solve this problem pls. i posted the code to understand what i did.

    function onloadxml()
    {
    if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
    }
    else
    {// code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.open("GET","heartz.xml",false);
    xmlhttp.send();
    xmlDoc=xmlhttp.responseXML;
    var x=xmlDoc.getElementsByTagName("party1");
    for(i=0;i {
    if(i==0)
    {
    var t=(x.getElementsByTagName("info")[0].childNodes[0].nodeValue);
    var image=(x
    .getElementsByTagName("ima")[0].childNodes[0].nodeValue);
    document.getElementById("partyone").innerHTML=t;
    document.getElementById("patyimg1").src=image;
    }
    else
    {
    var t=(x
    .getElementsByTagName("info")[0].childNodes[0].nodeValue);
    var image=(x
    .getElementsByTagName("ima")[0].childNodes[0].nodeValue);
    document.getElementById("partytwo").innerHTML=t;
    document.getElementById("patyimg2").src=image;
    }
    }
    }

Viewing 1 post (of 1 total)
  • The forum ‘CSS’ is closed to new topics and replies.