sairfan1 Posted June 9, 2011 Share Posted June 9, 2011 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 More sharing options...
Ingolme Posted June 9, 2011 Share Posted June 9, 2011 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.thanksIrfanThe 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 More sharing options...
jeffman Posted June 9, 2011 Share Posted June 9, 2011 A brief tutorial on using include files. Link to comment Share on other sites More sharing options...
peterdreilly Posted June 9, 2011 Share Posted June 9, 2011 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 More sharing options...
thescientist Posted June 9, 2011 Share Posted June 9, 2011 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.