ik heb dit script.. maar het werkt niet als je met Netschaap 6 kijkt.. komt doordar het niet w3c compliant is.. weet ik..
Ik heb gevonden dat ik dit moet oplossen door ipv document.all of document.layers gebruik te maken van window.document.getElementById() maar als ik dit doe
(div_string = "window.document.getElementById(" + the_div + ")";)
krijg ik compile errors..
Werkt window.document.getElementById() dan heel anders of doe ik gewoon iets fout?
Script:
<script language = "JavaScript">
var div_array = new Array("divOne","divTwo")
function changeDiv(the_div, the_change)
{
if (document.all)
{
div_string = "window.document.all." + the_div + ".style";
} else if (document.layers) {
div_string = "window.document." + the_div;
} else {
alert("sorry, this only works in 4.0 browsers");
return;
}
the_div = eval(div_string);
the_div.visibility = the_change;
}
function closeAll()
{
for (var loop=0; loop < div_array.length; loop++)
{
changeDiv(div_array[loop], "hidden");
}
}
function popUp(the_url) {fullWin = window.open(the_url,"","width=350, height=200");}
</script>
Ik heb gevonden dat ik dit moet oplossen door ipv document.all of document.layers gebruik te maken van window.document.getElementById() maar als ik dit doe
(div_string = "window.document.getElementById(" + the_div + ")";)
krijg ik compile errors..
Werkt window.document.getElementById() dan heel anders of doe ik gewoon iets fout?
Script:
<script language = "JavaScript">
var div_array = new Array("divOne","divTwo")
function changeDiv(the_div, the_change)
{
if (document.all)
{
div_string = "window.document.all." + the_div + ".style";
} else if (document.layers) {
div_string = "window.document." + the_div;
} else {
alert("sorry, this only works in 4.0 browsers");
return;
}
the_div = eval(div_string);
the_div.visibility = the_change;
}
function closeAll()
{
for (var loop=0; loop < div_array.length; loop++)
{
changeDiv(div_array[loop], "hidden");
}
}
function popUp(the_url) {fullWin = window.open(the_url,"","width=350, height=200");}
</script>