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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menu tricks...header file sorta question

Status
Not open for further replies.

iceman2654

Programmer
Jul 9, 2003
53
CA
I'm sure this is a simple thing but how do you load a file into another file. Sorta like a header. I'm creating a website and I want to have the menu as a sort of objec that I can put into every file so each time someone loads a different page the menu is there. If I change the menu then all the pages will show the updated menu. LOL can anyone understand what I'm saying?
 
Yep. Put all your javascript into a new file - no <script> tags or other HTML, just the javascript. Call this file &quot;menu.js&quot;.

Then in each page which you want the menu to display, put the following in the <head> section:
Code:
<script language=&quot;javascript&quot; src=&quot;menu.js&quot;></script>
And where you want your menu to display, simply call your menu function.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top