Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fly out menus

Status
Not open for further replies.

janet24

Technical User
Jul 22, 2003
161
US
Is it possible to have a fly out menu (not a form pull down menu) using either an include or .js document so when the buttons change you only have to change one document instead of changing the menu on each page.

thanks....
 
Copy whatever code you have between <script> and </script> tags into a text file with a .js extension and call it using:
<script src=&quot;myTextFile.js&quot;></script>

Adam
 
I have a .js file that is loaded exactly as you have stated above:

<script src=&quot;myTextFile.js&quot;></script>

In this .js file, I have this line:

<script src=&quot;myTextFile.js&quot;></script>

unfortunately I can't seem to embedd a .js call within a .js file......

Is it possible to do this?
if so how?

Thanks,
NoChoice
 
Sure... put this in the first .js file:

document.write('<scr'+'ipt src=&quot;myTextFile.js&quot;></scr'+'ipt>');


Adam
 
I haven't had a chance to try this yet, I'm assuming that it works, so here's my next question: Why will it work if I break up the word script?

It just doesn't make sense to me, I'm not saying that it doesn't, I just don't understand.......

thanks,
NoChoice
 
I think it's because when the script parser encounters the </script> tag it stops.

Adam
 
A .js file should not contain a script tag -- only functions.

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
It worked for me....now when somebody makes a change to the fly out window I just have to change the .js file. And they've already made a change to the menu, imagine that!

Thanks....
 
Actually...I just realized the fly-out menus don't seem to work in Netscape but work in explorer...they worked when they were on the same page.

This is what I have....any suggestions.

<script language=&quot;JavaScript&quot; src=&quot;../common_images/mm_menu.js&quot;></script>
<script language=&quot;JavaScript&quot; src=&quot;intro_scripts/intro_menu.js&quot;></script>
 
Use

Code:
<script src=&quot;../common_images/mm_menu.js&quot; type=&quot;text/javascript&quot;></script>
<script src=&quot;intro_scripts/intro_menu.js&quot; type=&quot;text/javascript&quot;></script>

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top