I want to generate three pages in html 1.header 2.container 3.footer in different html pages And last i want to integrate all 3 html page in single page as index.html.
Please tell me how will i do this??
I want to generate three pages in html 1.header 2.container 3.footer in different html pages And last i want to integrate all 3 html page in single page as index.html.
Please tell me how will i do this??
You can done this with angularjs easily using ng-include directive to learn about this follow below link.
Use jQuery, https://stackoverflow.com/a/18712605/6385066
index.html
<html>
<head>
<title></title>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script>
$(function(){
$("#header").load("header.html");
$("#footer").load("footer.html");
});
</script>
</head>
<body>
<div id="header"></div>
<!--Remaining section-->
<div id="footer"></div>
</body>
</html>
You can reuse the function for all your pages to include your header and footer.
Please try the below method
<html>
<head>
<title>test page</title>
<script src="http://code.jquery.com/jquery-3.0.0.min.js"></script>
</head>
<body>
<div id="header"></div>
<br />
<div id="content">
Main Content
</div>
<br />
<div id="footer"></div>
<script>
$("#header").load("header.html");
$("#footer").load("footer.html");
</script>
</body>
</html>
Would suggest you to go through the below links as well