can I use <link> to import external HTML?

liunx

Guest
I've got a small standardized menu on my web site that's included of several dozen pages. Obviously I don't want to edit all of those pages each time I make a change to the menu. I want the menu in an external file that I can import into each page.<br />
<br />
I managed to do it with JavaScript, using writeln () to output the HTML for the menu. It works, but it's not pretty.<br />
<br />
I settled on that after I was unable to find a way to import HTML directly.<br />
<br />
Isn't there a way to use <link>? It seems like there should be, but I can't make it work.<br />
<br />
Thanks in advance<!--content-->Does your server support ASP or PHP? There's a very easy solution to your problem using either one of those. If you have PHP available to you, look for tutorials on "PHP include" or "PHP require". I use it on my site for the same thing you are looking to do. One file contains my navigation, and all other files include this file in them using PHP.<!--content-->What you need is a server-side scripting, like ASP or PHP.<br />
<br />
For ASP you can do this within your html:<br />
<br />
<!--#include file="file_to_include.asp"--><br />
<br />
<br />
For PHP, within the PHP code:<br />
<br />
<?php<br />
<br />
include "file_to_include.php";<br />
<br />
<br />
?><br />
<br />
where "file_to_include.asp/php" has the html (no script tags are needed) for you menu. <br />
<br />
<br />
hope this helps<!--content-->My server does support PHP, but I don't have a test/development environment that does yet. Guess I should get moving on that.<br />
<br />
Thanks<!--content-->
 
Back
Top