When the window loads, it is supposed to execute a piece of Javascript, which highlights a button, and displays links below it.
Here is the code segment for the window load.
So it is supposed to execute requestProd().
RequestProd() is defined in a file called service.js as:
Here are 3 buttons, one of which (the one for Products), should get automatically invoked by the window load:
Can anyone think of a reason why the execution of the window load for requestProd() doesnt work?
Here is the code segment for the window load.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>homepage</TITLE>
<link href="main.css" rel="stylesheet" type="text/css">
<link href="ddmenu.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="js/services.js"></script>
<script type="text/javascript">
window.onload = function () { requestProd(); }
window.onload = function () { setTimeout('clearPreloadPage()',0); }
</script>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function clearPreloadPage()
{ //DOM
if (document.getElementById)
{
document.getElementById('prepage').style.visibility='hidden';
document.getElementById('servcountry').style.visibility='visible';
}
else
{
if (document.layers)
{ //NS4
document.prepage.visibility = 'hidden';
document.servcountry.visibility = 'visible';
}
else
{ //IE4
document.all.prepage.style.visibility = 'hidden';
document.all.servcountry.style.visibility = 'visible';
}
}
}
// End -->
</SCRIPT>
So it is supposed to execute requestProd().
RequestProd() is defined in a file called service.js as:
Code:
function requestProd() {
document.imgProd.src = 'elements/products1.gif';
document.imgServ.src = 'elements/services0.gif';
document.imgEven.src = 'elements/events0.gif';
document.forms['prods'].find.value = 'products';
if (!oIFrame) {
createIFrame();
setTimeout(requestLinks, 10);
return;
}
var sCountry = document.getElementById("servcountry").value;
var sServ = document.getElementById("find").value;
oIFrame.location = "requestlinks.php?find=" + sServ + "&country=" + sCountry;
}
Here are 3 buttons, one of which (the one for Products), should get automatically invoked by the window load:
Code:
<td><a href="#srv"><img src="elements/services0.gif" border="0" name="imgServ" id="imgServ" onclick="requestServ()" /></a></td>
<td><a href="#srv"><img src="elements/events0.gif" border="0" name="imgEven" id="imgEven" onclick="requestEven()" /></a></td>
<td><a href="#srv"><img src="elements/products1.gif" border="0" name="imgProd" id="imgProd" onclick="requestProd()" /></a></td>
<td>
Can anyone think of a reason why the execution of the window load for requestProd() doesnt work?