 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
Corey Bryant

Joined: 15 May 2004 Posts: 8154 Location: Castle Rock CO USA
|
Posted: Sat Mar 04, 2006 3:27 pm Included Content |
|
|
|
|
Well there are actually at least six ways:
SSI - and using the extension shtml or shtm (server side)
ASP - using the extension asp (server side)
PHP - using the extension php, phtml, phtm (server side)
JavaScript - using the extension html or htm (client side)
Ajax - more information Ajax Includes Script
Frames - Frames Tutorial
They depend on your server and the way it is set up. Including the file is is basically like
SSI
| Code: |
| <!--#include file="includes/nav.html" --> |
ASP
| Code: |
| <!--#include file="includes/nav.html" --> |
PHP
| Code: |
| <?php include("includes/nav.html"); ?> |
JavaScript
| Code: |
| <script src="includes/nav.js"></script> |
(With JavaScript though, some search engines might not be able to read it and I do not recommend it. This should be used only if your server cannot support SSI, ASP, PHP and / or you need to keep your html extensions on your files.)
With the server side the file is parsed on the server before being rendered in the browser. The nav.html would have your code that is your navigation only - for example:
| Code: |
| | <a href="/default.asp">Home</a> | <a href="/about.asp">About</a> | <a href="/contact.asp">Contact</a> | |
And that would be it - nothing else is needed since everything else will be pulled from the main page that is calling for the included content.
With the JavaScript, you it would be a bit different, you would save this as nav.js:
| Code: |
<!--
document.writeln("| <a href=\"/default.asp\">Home</a> | <a href=\"/about.asp\">About</a> | <a href=\"/contact.asp\">Contact</a> |");
//--> |
and then call it in the page like this:
| Code: |
| <script src="includes/nav.js"></script> |
however, some search engines do not read JavaScript since it is a client side language is (if by chance) the user has JavaScript disabled, then they would not see the JavaScript.
For the type of hyperlinks check out types of hyperlinks - I would recommend using Virtual if you do use the server side includes.
Check with your hosting company to see what server side includes they will support.
_________________
Corey
Toll Free Fax Numbers | Merchant Accounts |
|
Corey Bryant

Joined: 15 May 2004 Posts: 8154 Location: Castle Rock CO USA
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|
 |
|
|
|
|
|
|