Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cross Browser Referencing

Status
Not open for further replies.

scousethemoose

Programmer
Jul 14, 2002
69
AU
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.

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
 
Really appreciate your help on this Jeff. This is semi working now, I will post the updated code once I get it working.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top