Re: "is not defined" errors only in Firefox
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: "is not defined" errors only in Firefox

From: web.dev <web.dev.cs@gmail.com>
Date: Tue Feb 28 2006 - 20:21:28 CET

forwardtrends wrote:
> function setStyle(element, property, value) {
> element = document.getElementById(element);
> if(element.style) {element.style[property] = value;}
> }
>
[snip]
> setStyle(handbookPop, 'display', 'none');
> setStyle(handbookPop, 'display', '');

handbookPop is not defined because you are sending an undefined value
to your function setStyle function. Change it to the following
accordingly:

setStyle("handbookPop", "display", "none");
setStyle("handbookPop", "display", "");

handbookPop should be a string.

> But when I use a <body onLoad="javascript:hideDiv();">
> show div

Javascript pseudo-protocol is a very bad practice. Try searching the
groups here, and you'll get many reasons as to why it is so.
Received on Mon May 1 03:41:32 2006