Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Header and Footer Script

    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!

  • #2
    Regular Coder
    Join Date
    Apr 2003
    Location
    Atlanta, GA
    Posts
    487
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    São Paulo, Brazil
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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>
    /Daniel


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •