Ofcourse there are other solutions like using frames so that now there is only 1 file to modify.
But what if you dont want to use frames.... Javascript to the rescue.
Use Javascript document.write method to write out the html code to your page. Place this javascript code in a something.js file and include something.js in every page where you want to have that html code present.
Including for javascript is as simple as
<script language="javascript" src="something.js">
I typically write 2 functions in this file, namely writeHeader() and writeFooter(). At the exact location where I want the code to be written I call this function
Example :
<body class="main" onload="MM_preloadImages('images/mmenuhomeon.gif','images/mmenuabouton.gif','images/mmenueventson.gif','images/mmenugovernon.gif','images/mmenubbon.gif','images/mmenulinkson.gif','images/mmenucontactoff.gif')">
<script type="text/javascript">writeHeader()script>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
...
...
-----------------------------------------------------------------
No comments:
Post a Comment