Try == in the commented out if statement instead of =.

On Mon, Feb 16, 2004 at 10:19:43AM -0700, Wendy Smoak wrote:
> From: "Matt Raible" <[EMAIL PROTECTED]>
> > Wendy wrote:
> > > only considering the cookie value to pick the correct tab to display.
> >
> > That sounds like a good solution to me.
> >
> 
> Thanks!  So far, I have this:
> 
> function activateMenu() {
>     var menu = document.getElementById("menuList");
>     var items = menu.getElementsByTagName("li");
>     var menuSelected = getCookie("menuSelected");
>     //if ( typeof( menuSelected ) = "undefined" ) { menuSelected=0; }// <--- 
> need help here
>     items[menuSelected].className+="selected";
> }
> 
> I need to handle the case where the cookie doesn't get set, and default to
> menuSelected=0.  I tried the commented-out line above, but if I put that in,
> then the last line above gives a syntax error. (?)  Unfortunately, I'm not
> very good with JavaScript.  Can someone help?
> 
> -- 
> Wendy in Chandler, AZ
> 
> 
> 
> -------------------------------------------------------
> SF.Net is sponsored by: Speed Start Your Linux Apps Now.
> Build and deploy apps & Web services for Linux with
> a free DVD software kit from IBM. Click Now!
> http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
> _______________________________________________
> struts-menu-user mailing list
> [EMAIL PROTECTED]
> https://lists.sf.net/lists/listinfo/struts-menu-user
<snip>


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
struts-menu-user mailing list
[EMAIL PROTECTED]
https://lists.sf.net/lists/listinfo/struts-menu-user

Reply via email to