Hello all,
I am haveing a bit of an issue. i can seem to get a dynamically created table to work in FF and an XML parser but for some reason i cannot seem to get them to work together in FF. it works great in IE.. any ideas.. here is the final code i have tried using. Also if someone could help assist on how to add a new tr for every 6 td created? thanks in advance.
[code]
<html>
<body onload=”loadXML()”>
<div id=’New_Note’>testing </div>
</body>
<script>
var xmlDoc;
function loadXML(){
var AA = document.getElementById(‘New_Note’);
if (window.ActiveXObject)
{
xmlDoc=new ActiveXObject(“Microsoft.XMLDOM”);
}
else if (document.implementation && document.implementation.createDocument)
{
xmlDoc=document.implementation.createDocument(“”,””,null);
}
var BB = document.createElement(‘table’);
var CC = document.createElement(‘tbody’);
var DD = document.createElement(‘tr’);
var EE;
xmlDoc.async=”false”;
xmlDoc.load(“note.xml”);
nodes = xmlDoc.getElementsByTagName(“Info”)[0].childNodes;
BB.setAttribute(‘id’,’ff’);
BB.setAttribute(‘name’,’ff’);
BB.setAttribute(‘className’, ‘NN’);
AA.appendChild(BB);
BB.appendChild(CC);
CC.appendChild(DD);
for (i=0;i<nodes.length;i++){
EE=DD.insertCell(-1);
EE.setAttribute(‘id’,nodes[i].getAttribute(“id”));
EE.setAttribute(‘Name’,nodes[i].getAttribute(“name”));
EE.setAttribute(‘className’, ‘ZZ’);
EE.innerHTML=nodes[i].getAttribute(“name”);
DD.appendChild(EE);
}
}
</script>
</html>
and here is an examle of the xml file contents
[code]
/// example xml doc
<?xml version=”1.0″ encoding=”ISO8859-1″ ?>
<info>
<client id=”1″ name=”john smith” />
<client id=”2″ name=”jane doe” />
</info>