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!

Why is Netscape killing my design?

Status
Not open for further replies.

RLA

Instructor
Feb 22, 2002
22
US
Hi,
I have a webpage where I use a javascript function (below) in order to make my page behave like a tree menu (basically, when you click the plus a hidden cell displays and when you click the minus it hides). However, Netscape keeps giving me the following error:
document.cmarquee01 has no properties.
...
document.getElementById is not a function.
But this is a function! Does anyone have any ideas why it's not working? I've tried it in Netscape 4, 6, and 7 -- in 7, it works but opens a blank javascript error page.
Thanks~


<script language=&quot;javascript&quot;>
function ToggleExpanded(cellID, gifID) {
// Toggle visible or not
if (document.getElementById(cellID).style.display=='block') {
document.getElementById(cellID).style.display='none'
} else {
document.getElementById(cellID).style.display='block'
}

// Toggle images
if (document.getElementById(cellID).style.display=='block') {
document.getElementById(gifID).src='images/minus.gif'
} else {
document.getElementById(gifID).src='images/plus.gif'
}
}
</script>
 
Could this be a IE vs. Netscape issue? iSeriesCodePoet
IBM iSeries (AS/400) Programmer
[pc2]
 
Hi RLA, to begin with:

1) NS4 uses document.layers
2) NS6+ uses document.getElementByID

This would explain why your script doesn't work in NS6-...as for why this doesn't work for NS6+ is a mystery, can you post your entire code or point to a URL so that we can see in action?? I have not failed; I have merely found 100,000 different ways of not succeding...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top