PHPBuilder Community is the best help I have found.
I always get the fastest answers on this forum and they are usually always correct...so I was wondering if someone could give me a bit of JavaScript help
I found a show/hide div layer script which works great in Firefox, and is supposed to work in IE as well, but I am getting an error
Line: 478
Char: 3
Error: Expected ';'
Code: 0
URL: http://plurpage.com/everquest/dontest.php
Here is that specific block of code
var state = 'none';
function showhide(layer_ref) {
if (state == 'block') {
state = 'none';
} else {
state = 'block';
}
if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval("document.all."+ layer_ref +".style.display = state");
}
if (document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].display = state;
}
if (document.getElementById &&!document.all) {
hza = document.getElementById(layer_ref);
hza.style.display = state;
}
}
line 478 is the eval line...I am by far no JS guru so lets keep that in mind when replying 😛
I have also tried changing the eval string to
eval("document.all."+ layer_ref +".style.display = state;");
and
eval("document.all."+ layer_ref +".style.display = '" + state + "';");