I wrote this snippet for an expandable directory listing and it returns a JAVASCRIPT ERROR:
Line 64:
Char 8
Error: Coould not get the Visibility property. Wrong argument
Here is the code:
<HTML>
<HEAD>
<TITLE>My Drop Down</TITLE>
<SCRIPT LANGUAGE=javaScript>
<!--
//First DropDown Menu
var ary1 = new Array();
//don't know why these appear so funny in this post
//there is only 1 semicolon at end of each line
ary1[0] = "<A HREF=\" ary1[1] = "<A HREF=\" ary1[2] = "<A HREF=\" ary1[3] = "<A HREF=\"
//Determine Browser
var IE = document.all?true:false;
var NN = document.layers?true:false;
var WW3 = document.getElementById&&!document.all?true:false;
var OP = navigator.userAgent.indexOf("Opera"
?true:false;
var dvFavs;
var dvlst1;
function OnLoad()
{
//Format "visibility"
if (IE||OP)
{
hide= "hide";
show= "show";
}
if (NN)
{
hide= "hidden";
show= "visible";
}
if (WW3)
{
hide= "hidden";
show= "visible";
}
//Format DIV's
dvFavs = Lens("Favs"
;
dvlst1 = Lens("list1"
;
}
function Lens(obj)
{
if (NN)
dv = document.layers[obj]
if (WW3)
dv = document.getElementById(obj)
else
dv = document.all[obj]
return dv;
}
function ExpColl(dv)
{
if (dv.style.visibility == hide)
{
dv.style.visibility = show;
}
else
{
dv.style.visibility = hide;
}
}
//-->
</SCRIPT>
</HEAD>
<BODY onload="OnLoad();">
<FORM>
<TABLE border=0>
<TR>
<td>
<DIV class=Parent ID=Favs onClick="ExpColl(dvlst1);">My Favorites
<DIV ID=list1 style="position:absolute;left:0;top:0;width:120;visibility:hidden;">
<script language="JavaScript1.2">
<!--
for (i=0;i<ary1.length;i++)
document.write(ary1);
//-->
</script>
</DIV>
</DIV>
</td>
<TR>
<TR>
<td>
</td>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
Can anyone spot an obvious error?
Thanks...
Line 64:
Char 8
Error: Coould not get the Visibility property. Wrong argument
Here is the code:
<HTML>
<HEAD>
<TITLE>My Drop Down</TITLE>
<SCRIPT LANGUAGE=javaScript>
<!--
//First DropDown Menu
var ary1 = new Array();
//don't know why these appear so funny in this post
//there is only 1 semicolon at end of each line
ary1[0] = "<A HREF=\" ary1[1] = "<A HREF=\" ary1[2] = "<A HREF=\" ary1[3] = "<A HREF=\"
//Determine Browser
var IE = document.all?true:false;
var NN = document.layers?true:false;
var WW3 = document.getElementById&&!document.all?true:false;
var OP = navigator.userAgent.indexOf("Opera"
var dvFavs;
var dvlst1;
function OnLoad()
{
//Format "visibility"
if (IE||OP)
{
hide= "hide";
show= "show";
}
if (NN)
{
hide= "hidden";
show= "visible";
}
if (WW3)
{
hide= "hidden";
show= "visible";
}
//Format DIV's
dvFavs = Lens("Favs"
dvlst1 = Lens("list1"
}
function Lens(obj)
{
if (NN)
dv = document.layers[obj]
if (WW3)
dv = document.getElementById(obj)
else
dv = document.all[obj]
return dv;
}
function ExpColl(dv)
{
if (dv.style.visibility == hide)
{
dv.style.visibility = show;
}
else
{
dv.style.visibility = hide;
}
}
//-->
</SCRIPT>
</HEAD>
<BODY onload="OnLoad();">
<FORM>
<TABLE border=0>
<TR>
<td>
<DIV class=Parent ID=Favs onClick="ExpColl(dvlst1);">My Favorites
<DIV ID=list1 style="position:absolute;left:0;top:0;width:120;visibility:hidden;">
<script language="JavaScript1.2">
<!--
for (i=0;i<ary1.length;i++)
document.write(ary1);
//-->
</script>
</DIV>
</DIV>
</td>
<TR>
<TR>
<td>
</td>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
Can anyone spot an obvious error?
Thanks...