I am trying to call a function which initializes my DHTML menu (using <ul> and <li>) when the page loads.
Since I am working within a portal environment, I cannot call the event from the body statement.
Is there anywhere else I can place this code so that it will initialize the menu when the page loads?
function initialiseMenu()
{
var objLICollection = document.body.getElementsByTagName("LI");
for(var i = 0; i < objLICollection.length; i++)
{
var objLI = objLICollection[i];
for(var j = 0; j < objLI.childNodes.length; j++)
{
if(objLI.childNodes.item(j).nodeName == "UL")
{
objLI.onmouseover=showSubMenu;
objLI.onmouseout=hideSubMenu;
for(var j = 0; j < objLI.childNodes.length; j++)
{
if(objLI.childNodes.item(j).nodeName == "A")
{
objLI.childNodes.item(j).className = "hassubmenu";
}
}
}
}
}
}
Tim Ellison - 29 Sep 2003 17:41 GMT
You could script it out in the body of your html as follows:
<SCRIPT language="javascript" defer>
...
</SCRIPT>
"defer" will allow the page to load then the script will execute.

Signature
Regards,
Tim Ellison, MCP
Whitlock eBusiness Solutions
(w) 804-794-2871 x144
(m) 804-405-4874
> I am trying to call a function which initializes my DHTML menu (using <ul> and <li>) when the page loads.
>
[quoted text clipped - 26 lines]
> }
> }