This Message Forum is no longer in use

Please use the new Bravenet Help Forums FOUND HERE

General Forum
This Forum is Locked
Author
Comment
Using a Header File to Embed on All HTML Pages

I'm trying to create a single header.html file that will then embed into all my other HTML pages using this code:



It has worked on a previous webhosting service but is not working on Bravehost. Can someone please help me figure this out?

It would be greatly appreciated.

Browser: Internet Explorer

OS: Windows Vista

Re: Using a Header File to Embed on All HTML Pages

you have a free subdomain with free hosting

so perhaps NOT ALL things you did elsewhere will work with bravenet especially with the free hosting/free subdomain you have

Re: Using a Header File to Embed on All HTML Pages

----
you have a free subdomain with free hosting

so perhaps NOT ALL things you did elsewhere will work with bravenet especially with the free hosting/free subdomain you have


That's pretty much what I thought. I was hoping there might be a work around for it but if not, then ses la vie.

Re: Using a Header File to Embed on All HTML Pages

A "#include" is considered a "Server Side Include" (SSI), and server-side scripting is not supported on free web site. A work around would be to use Javascript. The Javascript would run in the visitors browser and not require anything from the server.

It's a little more complicated than using a simple "#include" command. The HTML you want to insert into your page would need to be converted to a series of document write commands. The only thing that gets a little tricky is syntax, making sure you quote and escape everything correctly. If you only have a few lines for a header or menu, it's pretty simple. I use it regularly to dynamically write display windows based on calculations and user entered data.

Some users disable Javascript, but based on my site stats, that only accounts for less than 5% of my site visitors. But I don't worry about that percentage because, unless they enable Javascript, nothing else on my site works.

You might want to check out this web page at "Boutell.com" on How do I include one HTML file in another?. It goes over the various methods and has a good description on how to do it with Javascript.

Browser: Firefox, Netscape, Sea Monkey, Internet Explorer, .....

OS: Solaris (Sparc,x86), Linux, XP