Jump to content

Common Header and Footer for all html pages.


sairfan1

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...