Board Logo

Javascript-Command as menu item
MaxFromH - 9/23/2005 at 03:51 PM

I would like to invoke a Javascript command instead of a href-Link. E.g., I would like to show the menu items, when the user clicks on the "closed folder"-item (like javascript: trees[0].toggle(1)).

What is the exact syntax for the menu item?


MaxFromH - 9/23/2005 at 04:56 PM

P.S. When I try

['Level 0 Item 1', "javascript: trees[0].toggle(1)",
['Level 1 Item 0', 'nul'],
['Level 1 Item 1', 0,
['Level 2 Item 0'],
.....

I get the IE error message "'trees.0' is null or no object."

What did I do wrong?


rock - 9/26/2005 at 11:15 AM

Check target frame setting (trees should be defined in the target frame).


MaxFromH - 9/26/2005 at 01:49 PM

Is there any code example available, how I can influence the menu in the "navigation"-frame from a javascript in the "content"-frame?


rock - 9/27/2005 at 10:44 AM

To access the trees array in 'content' frame try following model:
top.frames['navigation'].trees.toggle(1);


MaxFromH - 9/27/2005 at 04:09 PM

It works :-))

Thanks, Rock!


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/