scousethemoose
Programmer
Hi everyone, I have been playing around with a tutorial I found for creating an xml tree.
The tutorial was IE focused and I have managed to convert it to support firefox. I can load and tranform the xml fine but I am having trouble trying to make the javascript with acts on the tree compliant.
The code below expands nodes and is called on the onclick event of a DIV.
I know the issue is to do with how I am referencing and I have played around with a few ways but nothing seems to work.
Can someone point me in the right direction?
Thanks
The tutorial was IE focused and I have managed to convert it to support firefox. I can load and tranform the xml fine but I am having trouble trying to make the javascript with acts on the tree compliant.
The code below expands nodes and is called on the onclick event of a DIV.
Code:
function expand(entity) {
var oImage
oImage = entity.childNodes(0).all["image"]
oImage.src = entity.imageOpen
for(i=0; i < entity.childNodes.length; i++) {
if(entity.childNodes(i).tagName == "DIV") {
entity.childNodes(i).style.display = "block"
}
}
entity.open = "true"
}
I know the issue is to do with how I am referencing and I have played around with a few ways but nothing seems to work.
Code:
oImage = entity.getElementsByTagName('images')[0]
Can someone point me in the right direction?
Thanks