Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Init() function on body onLoad event

Status
Not open for further replies.

BG12424

Programmer
Jun 4, 2002
717
US
<html>
<head>

<script language=&quot;JavaScript&quot; src=&quot;navcond.js&quot;></script>
<script language=&quot;JavaScript&quot;>

var myNavBar1 = new NavBar(0);
var dhtmlMenu;

dhtmlMenu = new NavBarMenu(60, 120);
dhtmlMenu.addItem(new NavBarMenuItem(&quot;Category1&quot;,&quot;dhtmlMenu.addItem(new NavBarMenuItem(&quot;SubCategory1&quot;, &quot;dhtmlMenu.addItem(new NavBarMenuItem(&quot;SubCategory2&quot;, &quot;dhtmlMenu.addItem(new NavBarMenuItem(&quot;SubCategory3&quot;, &quot;dhtmlMenu.addItem(new NavBarMenuItem(&quot;SubCategory4&quot;, &quot;dhtmlMenu.addItem(new NavBarMenuItem(&quot;SubCategory5&quot;, &quot;myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(60, 120);
dhtmlMenu.addItem(new NavBarMenuItem(&quot;Category2&quot;,&quot;dhtmlMenu.addItem(new NavBarMenuItem(&quot;SubCategory6&quot;, &quot;dhtmlMenu.addItem(new NavBarMenuItem(&quot;SubCategory7&quot;, &quot;myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(60, 120);
dhtmlMenu.addItem(new NavBarMenuItem(&quot;Category3&quot;,&quot;myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(60, 120);
dhtmlMenu.addItem(new NavBarMenuItem(&quot;Category4&quot;,&quot;myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(60, 120);
dhtmlMenu.addItem(new NavBarMenuItem(&quot;Category5&quot;,&quot;myNavBar1.addMenu(dhtmlMenu);

myNavBar1.setColors(&quot;#999999&quot;, &quot;#000000&quot;, &quot;#cccccc&quot;, &quot;#000000&quot;, &quot;#99CCFF&quot;, &quot;#000000&quot;, &quot;#ffffff&quot;, &quot;#000000&quot;, &quot;#99CCFF&quot;)
myNavBar1.setFonts(&quot;Arial, Helvetica, Geneva, sans-serif&quot;,&quot;plain&quot;,&quot;bold&quot;,&quot;11px&quot;,&quot;Arial, Helvetica, Geneva, sans-serif&quot;,&quot;plain&quot;,&quot;normal&quot;,&quot;10px&quot;)
myNavBar1.setSizes(1,3,1)

var fullWidth;

function menuinit() {

myNavBar1.resize(654);
myNavBar1.create();
myNavBar1.setzIndex(2);
myNavBar1.moveTo(146, 150);
}
</script>

I get an &quot;Object Expected&quot; error message when I load my page. This is where the culprit is at, can anyone help me? Thanks.

<body leftmargin=&quot;0&quot; topmargin=&quot;0&quot; onLoad=&quot;menuinit();javascript:document.frmLogin.txtPassword.focus();&quot;>
regards,
Brian

AG00280_.gif
 
I should add that this code is in a serverside include and being loaded in the <head> tag. Also the menu arrays are being generated using ASP response.writes regards,
Brian

AG00280_.gif
 
Never mind, I solved the problem. I forgot to add an extra &quot;right paranthesis&quot; around the additem method above. regards,
Brian

AG00280_.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top