Reputation: 47
I'm sure I remember doing this once but can't remember how.
What I'm trying to do is write a navbar in html in one place and have every page take the html code from the file and add it to the page when the page loads. PHP doesn't work (I suspect I need a server for PHP to work which I don't even intend to use)
Something like:
Navbar file:
<div>
other code...
</div>
Main webpage file:
<html>
<header>
</header>
<body>
</body>
<div>
put navbar file code here...
</div>
</html>
Upvotes: 1
Views: 760
Reputation: 2674
<iframe src="file_with_only_div_content.html" allowtransparency="true" frameborder="0"></iframe>
Upvotes: 1
Reputation: 5213
You mean http://en.wikipedia.org/wiki/Server_Side_Includes server side includes?
<!--#include virtual="../quote.txt" -->
Are these even supported anymore?
In order for a web server to recognize an SSI-enabled HTML file and therefore carry out these instructions, either the filename should end with a special extension, by default .shtml, .stm, .shtm, or, if the server is configured to allow this, set the execution bit of the file.
Upvotes: 0