I'm having a bit of trouble getting my JavaScript to run in Navigator 7 / Mozilla 1.*. The following is the code library I am using between <head></head> tags (probably irrelevant). It all works fine and dandy in Internet Explorer 6, but in NS/Mozilla anything that refers to something in this block of script doesn't work. When I reference a function in this code block and open up
JS Console in Navigator, it complains that the function in undefined.
I have similar script contained in a separate block that is used for dynamic menus that works in Navigator, but behaves unpredictably, the onmouseout event handler doesn't *always* behave as it should, it only works part of the time.
I'm going nutty trying to get this thing sorted, is there something obvious in this code that is causing the Gecko browsers to choke? (This is output from PHP, so take heed of any strange syntax... that is included variables/constants from the PHP side of things).
There is also an occaisonal error that pops up in
JS console, saying something about a missing parenthesis near the function declaration for goto.. yet I can not see where one is missing (even more boggling is the whole thing works in IE 6). Here is the error text:
Error: missing ( before formal parameters
Source File:
http://smilingsouls.net/
Line: 84, Column: 13
Source Code:
function goto(the_location)
So far I've come up with naught from Google...
I'd sincerely appreciate a fresh pair of eyes!
: )
Rich
Code:
<script language='JavaScript' type='text/javascript'>
function draw_window(info_path, window_name, x, y)
{
var open_path;
var open_attributes;
open_path = '{$_SERVER["PHP_SELF"]}?jsinclude_path=' + info_path;
open_attributes = 'width=' + x + ', height=' + y + ', scrollbars = yes, resizable = yes';
window.open(open_path, window_name, open_attributes);
return;
}
function bg_onfocus(this_field, error_boolean)
{
if (error_boolean == true)
{
document.getElementById(this_field).style.color = '".COLOR_INPUT_TEXT."';
}
document.getElementById(this_field).style.background = '".COLOR_ONFOCUS."';
return;
}
function bg_onblur(this_field, error_boolean)
{
if (error_boolean == true)
{
document.getElementById(this_field).style.color = '".COLOR_INPUT_TEXT."';
}
document.getElementById(this_field).style.background = '".COLOR_INPUT."';
return;
}
function bgin(id)
{
document.getElementById(id).style.background = '".COLOR_BODY."';
document.getElementById(id).style.borderWidth = 1 + 'px';
return;
}
function bgout(id)
{
document.getElementById(id).style.background = 'transparent';
document.getElementById(id).style.borderWidth = 0 + 'px';
return;
}
function menu_in(id)
{
document.getElementById(id).style.display = 'block';
return;
}
function menu_out(id)
{
document.getElementById(id).style.display = 'none';
return;
}
function goto(the_location)
{
location.href = the_location;
return;
}
var scrolling;
function startScroll(theframe)
{
scrolling=setInterval('window.' + theframe + '.scrollBy(0,12);', 100);
}
function stopScroll()
{
clearInterval(scrolling);
}
function back(theframe)
{
scrolling=setInterval('window.' + theframe + '.scrollBy(0,-12);', 100);
}
</script>\n";
:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::