...

View Full Version : Header and Footer Script



vipindoda
07-15-2003, 04:07 AM
Hello,

I've designed my web-site using HTML and SSI. Now, I've shifted to some other server. Unfortunately, new server does not support SSI, CGI, PHP, ASP. I need to insert some text on every page as header and another text as footer. Is there any way to do so through JavaScript or any other mean?

Thanks

Best Wishes
Bye!

Choopernickel
07-15-2003, 02:38 PM
Yeah, there's a way, but it's kind of a kludge and not really worth the time and effort required.

Create a function that writes out the HTML of your page header, then another that writes out the HTML of your page footer. Place them in a file called layout.js or something. You only want to write out the HTML of displayed things, not the <html><head><body> tags.

Now, on each page, you can use the javascript functions to draw your layout around your content. Script src the layout.js file in your page head, then call the functions around your content.

That said: I do surf without javascript occassionally, especially looking at personal sites. This method would totally not work for me. I've told you of a way to use client-side "includes" that allow you to use a consistent page layout, but you may find it more graceful to just copy/paste the actual HTML into each page.

Danne
07-15-2003, 03:33 PM
Another way is to use frames. One header and one footer.

Frameset:
<html>
<head>
<title> Título </title>
</head>
<body>
<frameset rows="50,*,50" cols=",">
<frame src="incHeader.html" name="frmHeader">
<frame src="body.html" name="frmBody">
<frame src="incFooter.html" name="frmFooter">
</frameset>
</body>
</html>

Iframes:
<html>
<head>
<title> Título </title>
</head>
<body>
<iframe src="incHeader.html" name="frmHeader"></iframe>

Content

<iframe src="incFooter.html" name="frmHeader"></iframe>
</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum