At 02:14 PM 1/13/05, Carl Reynolds wrote:
If I have a section of HTML that is the same in all my files, is there a way to put it in a file by itself and include it into each page?


Carl,

Here are two ways (I'll be interested to learn about others):

1) Use a server-side scripting language such as ASP, Perl, or PHP to include component files into one downloaded page. ASP can do this either with the #INCLUDE directive or through file I/O using the FileSystemObject object, and I'm sure the other server-side scripting languages have comparable methods.

2) Use a JavaScript inclusion directive in your HTML headers, e.g.:

        <script type="text/javascript" src="navmenu.js"></script>

...in which navmenu.js contains something like this:

        var navMenu = '<ul>
                <li><a href="aardvark.html">Aardvark</a></li>
                <li><a href="bananafish.html">Bananafish</a></li>
        </ul>'

...and then write the value of navMenu into your document structure.

Paul

******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************



Reply via email to