(aboutMe)

I'm a hack, but a pretty good one... as hacks go, that is...

(network)

(search)


« (FREE .TK Domain Names) // (home) // (Perpetual Copyright Date) »

Using Javascript For Headers And Footers…

by: havascript.com admin // March 12, 2007   ( ) {

Many people don’t realize that Javascript can be used to call external documents such as headers, footers, navigation, etc. - much in the same way SSI is utilized. The main disadvantage is that the code within the external document being called must have no line breaks,… i.e.:

<center><p>Text</p></center>

NOT

<center>
<p>
Text
</p>
</center>

This HTML code is then placed within a Javascript document.write statement like this:

document.write(’<center><p>Text</p></center>’)

The external document is saved as a .txt file (i.e. footer.txt) and is called using a Javascript tag like this:

<script language=”javascript” type=”text/javascript” src=”footer.txt”></script>

There is an excellent tutorial that can be found at NetMechanic.com.  The main advantage of using this method is that it can be used in almost any circumstance whereas SSI may not depending upon the webhost.



topics: Javascript //
}

Comments

You must be logged in to post a comment.