Hello Reader's. If you have developed the header and footer of the website separatly then it's very easy to make them render on a webpage. By using the JS you can call them with a single line of code as written below:-
<html>
<head>
<title></title>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script>
$(function(){
$("#header").load("header.php"); //set the path to your header file
$("#footer").load("footer.php"); // set the path to your footer file
});
</script>
</head>
<body>
<div id="header"></div>
<div id="footer"></div>
</body>
</html>
You just have to call the jquery code and give paths to you header and footer files. Div with the 'header' will include the data of header and same as footer also.
0 Comment(s)