How do I call a javascritp variable inside of a submenu?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
sbraun
Beginner
Beginner
Posts: 7
Joined: Wed Dec 06, 2006 4:03 am

How do I call a javascritp variable inside of a submenu?

Post by sbraun »

Hi All, Nice menus here. Love 'em.

Q: I set a variable early in the menu_data.js file. How do I call that variable back into a subMenu as part of the url?
See...

<script>
var testvar='choice3';

aI("text=any;url=http://www.mydomain.com?passvar=document.write(testvar);");

I want the url to link to
http://www.mydomain.com?passvar=choice3

Thanks in advance for any insight
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Try this:

Code: Select all

aI("text=any;url=http://www.mydomain.com?passvar="+testvar); 
Hope this helps,
Andy
sbraun
Beginner
Beginner
Posts: 7
Joined: Wed Dec 06, 2006 4:03 am

Post by sbraun »

Thanks Andy.
This works great.

sbraun
sbraun
Beginner
Beginner
Posts: 7
Joined: Wed Dec 06, 2006 4:03 am

Post by sbraun »

This functions works, but it turns out that it is not going to do what I need....

What I really need is to place a variable inside of a url, where the variable is the parent menu text selection. The parent menu text selection is dynamic.


How do I make this work:

aI("text=sometext;url=http://mydomain/mydirectory/myfile.tpl? ... tselection;");

Thanks for any assistance,
sbraun
Post Reply