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!

Rollover Script problem 1

Status
Not open for further replies.

wbodger

Programmer
Apr 23, 2007
769
US
I have this script

Code:
<SCRIPT type="text/javascript" LANGUAGE="JavaScript1.2">
<!--
    
    function showHide(childObj){
      var dom = document.all[childObj].style;
      if (dom.display == "none") {
          dom.display = "";
      } else {
          dom.display = "none";
      }
    }
    
// -->
</SCRIPT>

that works fine when I just say HTML at the top, but when I use

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]

it does not work and I don't what the problem is, can anybody out there give me a hand with this? Perhaps point me in the direction I need to go to figure this out?

Thanks,
Willie
 
Hi

I suppose you mean it not works in Mozillas.

That is because the [tt]document.all[/tt] is a proprietary Explorer thing. In Mozillas there is an emulation for it, but only in Quirks Mode.

I suggest to change that [tt]document.all[/tt] to [tt]document.getElementById()[/tt]. ( Supposing childObj is an [tt]id[/tt]. )

Feherke.
 
Cool, thanks. I will work from that end! Funny that it works without the Transitional DTD defined in Firefox. Anyway, thanks for the info!
 
Hi

wbodger said:
Funny that it works without the Transitional DTD defined in Firefox.
Yep, that is because the Quirks Mode. ( The current document's rendering mode is mentioned in the View Page Info window. )

If you find it funny, a somehow complete list of such differences is enumerated in the Mozilla Quirks Mode Behavior article on MDC.

Feherke.
 
Again, thank you for the info. I have been out of this loop for too long, trying to get caught back up!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top