Solved

Gotta be a way to "include" html from a seperate file!?

Posted on 2000-05-09
3
175 Views
Last Modified: 2013-11-18
Hello,

I want to have a navigation bar on the side of my pages, but don't want to have to maintain the navigation bar in every single page....

Seems there has to be a way that a html document can "include" another files html... similar to how images are called/inserted into documents...

I asked a similar question earlier and people told me to use cgi/asp/javascript ... I don't want to go this route.... also, SSI is not an option....

Thanks,
Keith
0
Comment
Question by:keithedward
3 Comments
 

Expert Comment

by:semkin
ID: 2793492
Hi Keith!
In this case..
Isn't it easier to make the navigation bar as a separate frame? :)

regards, semkin
0
 
LVL 2

Expert Comment

by:harnal
ID: 2793528
Hmmm...Scripts or frames, that is the question.  Why do you not want to use scripting?  
0
 
LVL 2

Accepted Solution

by:
Ber earned 50 total points
ID: 2794612
A simple answer is to use frames as stated above Just in case you don't know how to use frames here is some sample code to get you started:

<HTML>

<HEAD>
<TITLE>Your title here</TITLE>
</HEAD>

<FRAMESET cols="20%,*">
<FRAME SRC="sidebar.html" >
<FRAME src="main.html" Name="main" scrolling=auto>
</FRAMESET>

<NOFRAMES>
Your no frames HTML here
</NOFRAMES>

</HTML>

Sidebar.html will be your navigation bar and main will be where your webpages are displayed.you must reference the "main" frame using target

eg.: <A HREF = "Page1.htm"  TARGET="main">Page1</a>

This will specify a link to a page called page1 and the link will show up on the side bar provided you put the code in the side bar page "sidebar.html"

The other thing to watch out for is case sensitivity. This is the root of a lot of problems especially where links are involved and I suggest that you keep everything in lower case.

HTH
Ber...  
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question