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

inserting a menu from a seperate html file in every html file

Status
Not open for further replies.

iceman2654

Programmer
Jul 9, 2003
53
CA
Hello,
OKay this has been bugging me for a long time...
let's say i create a html file with a menu. I want to use that file and insert it into every html file ...so if I change something in the menu everything will change. Do you follow?

For those who program...
It's like having a menu as subroutine and calling it.
I want to do this so the menu will be easier to manage.

Thanks in advanced
 
Probably the best way to do this is with SSI. Here's a link on using SSI with Apache:

You can also do this with javascript by using an external javascript file that writes out the menu. You then just put this line in each html file that should have the menu:
Code:
<script src=&quot;yourJavascriptFile.js&quot;></script>
 
thanks a lot!! option 2 is exactly what i'm looking for. Thanks again for your help
 
If you do it with Javascript, visitors who surf with Javascript switched off (like, say, the Google search engine spider) will not see your menu and may not be able to get around your site.

SSI is more reliable (though generally only available when you pay for hosting). There's lots of infomation about them on these two FAQs: faq253-3309 faq253-2000


-- Chris Hunt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top