Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 16th, 2003, 09:25 PM
Registered User
 
Join Date: Aug 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to EagleMason32
Default How do I...

I have a link that I would like to automatically execute when a page loads. I can not seem to get the <body onload... to work correctly.

The link is href='javascript:document.apop.changeItem('8','Fun ding','','_')' I have tried every way that I can think of to get this to work but my I have lost all of my hair doing it.

This script dynamically dims a menu choice on a java menu I am using. When the page is loaded I would like to dim the menu item that loaded the page.

The 8 is the menu item, Funding is the button text and the '_' triggers the disable.

Thanks
Eagle
  #2 (permalink)  
Old August 17th, 2003, 07:40 PM
Authorized User
 
Join Date: Jun 2003
Location: Quezon City, MM, Philippines.
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to planeswalk
Default

Hi,

I gather your onLoad statement would be something like

  <body onLoad="javascript:document.apop.changeItem('8', 'Funding', '_')"> ?

Try changing the onLoad statement to onLoad="javascript:changeItem('8','Funding','_') and see what happens.

Cheers!


Marlon Villarama
Support Team
Web Burner Hosting
marlon@webburner.com
www.webburner.com
Toll-Free: 877-535-2876
  #3 (permalink)  
Old August 22nd, 2003, 07:24 PM
Registered User
 
Join Date: Aug 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to EagleMason32
Default

Hi,
Thanks for the reply, actually I got it to work by doing the following:

<body topmargin=120 background="Graphics/background.gif" bgcolor="#333399" text="#000000" alink="#FF0000" vlink="#000000" link="#FF0000" onload="init()">

<SCRIPT TYPE="text/javascript">
function init()
{
parent.left.document.apop.changeItem('1','Home','' ,'_');
parent.left.document.apop.changeItem('2','Staff',' ','body');
parent.left.document.apop.changeItem('3','Hours',' ','body');
parent.left.document.apop.changeItem('4','History' ,'','body');
parent.left.document.apop.changeItem('5','Lunches' ,'','body');
parent.left.document.apop.changeItem('6','Pictures ','','body');
parent.left.document.apop.changeItem('7','News Letters','','body');
parent.left.document.apop.changeItem('8','Funding' ,'','body');
parent.left.document.apop.changeItem('9_1','August Editorial','','_');
parent.left.document.apop.changeItem('10','The Board','','body');
parent.left.document.apop.changeItem('11','Our Mission','','body');
}
//-->
</SCRIPT>

This way I can control all of the menu's at one time. Thanks for the help...

Rick






Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.