Including One Html File Into Another
i want to include one html file into another, but it doesnt seem to work out the two files are C:/wamp/www/AuctionVilla/index.html and C:/wamp/www/AuctionVilla/header.html here's m
Solution 1:
If you only have HTML on your server, or you need only HTML files, you can use frames.
<framesetrows="25%,75%"><framesrc="header.html" /><framesrc="index.html" /></frameset>
or iframes
like this (in your index.html
file):
<iframesrc="header.html" />
But, it is not recommended as it creates a kind of table. If you have PHP on your server, create a PHP file, and use
include("header.html");
If you have SSI (Server Side Includes) on your webserver, then have this:
<!--#include virtual="header.html" -->
Personally, I suggest you to use PHP method.
Solution 2:
The only "include" mechanisms in HTML itself are (i)frames and objects.
HTML doesn't have an 'include' mechanism - I'm not sure where you've seen these solutions on StackOverflow. You've probably been looking at answers for a server side language such as PHP or ASP.
Post a Comment for "Including One Html File Into Another"