View Full Version : help with menu


CuJo
07-06-2003, 04:09 AM
ok heres my problem.....

1st, heres a bit of a line from the menu
Menu1="new Array ("TextToShow","Link","","",....);

in the help it says...

LINK-Text String
Can also be used to execute Javascript Statements, for instace if you want the link to open in the top window use "javascript:top.document.location.href='Link.html';"

So I'm trying to put this code in there...

<a href="#"
onClick="this.href=document.location.href.substring(0,
document.location.href.lastIndexOf('&'))+'&blank=users/login'">Login</a>
.........

So, i tried putting the code in like this...

Menu1=new Array("Login","javascript:this.href=document.location.href.substr ing(0,
document.location.href.lastIndexOf('&'))+'&blank=users/login';","",''",.......)

unfortunatly I got a java error:
Error1: Undetermined string constent
Error2: StartTop is undefined

-plz help, thx

Stormx
07-06-2003, 02:38 PM
Because HTML needs to know that its javascript, and because javascript doesn't need to know it's javascript, try putting this:

Menu1=new Array("Login","this.href=document.location.href.substring(0,
document.location.href.lastIndexOf('&'))+'&blank=users/login';","",''",.......)

No garantie it will work, i don't even understand the code lol

CuJo
07-06-2003, 04:57 PM
no it didnt work...

i got a Undetermined string constent error
same thing as before...........

Stormx
07-06-2003, 07:20 PM
Aah, hang on, try this.


Menu1=new Array("Login",this.href=document.location.href.substring(0,
document.location.href.lastIndexOf('&'))+'&blank=users/login';,"",''",.......)

CuJo
07-07-2003, 05:48 AM
yah, i know....

the code is wrong.....

CuJo
07-10-2003, 06:51 PM
plz help