Jump to content

Common Header and Footer for all html pages.


sairfan1
 Share

Recommended Posts

Hi im working with html4, and xhtml, i want to add common header and footer of page, for example i want to create two html files for header and footer, and then i want to import/add it to all pages so that if i change header file, header of all pages will update. please note that my pages are static with .htm extension.thanksIrfan

Link to comment
Share on other sites

Hi im working with html4, and xhtml, i want to add common header and footer of page, for example i want to create two html files for header and footer, and then i want to import/add it to all pages so that if i change header file, header of all pages will update. please note that my pages are static with .htm extension.thanksIrfan
The only method I could actually recommend would be to use PHP.If your server supports server-side includes you could use those instead. Server-side includes look like an ordinary HTML comment. I'd have to look it up to remember the syntax.
Link to comment
Share on other sites

another option would be to write a javascript for each and simply add the script to the page where you wish the info to appear: e.g. for the footer/address

<script type="text/javascript">writeAddress();</script></body></html>

If you the create a standard (x)html page as a template with your doctype and header/footer info in javascripts, any change you make to a script will automatically appear in each page.

Link to comment
Share on other sites

that could possibly be devastating if the user has javascript disabled. With a server side include, the content will show regardless.

Edited by thescientist
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...