Include file Header Footer through jQuery

jQuery help to include header footer in most easiest way in web pages. This is demo of how to include dynamic web page file in other webpages.

Steps to include file through jQuery.

1. Download jQuery from http://jquery.com/

2. Make a header page

<table width="200" border="1">
  <tr>
    <td>This is header page content</td>
  </tr>
</table>

3. Include this header page in other web pages

<html>
<head>
<title>Main Page</title>
<script src="jquery-1.4.2.min.js"></script>
</head>

<body>
<div id="header"></div>
	<script>
	$('#header').load('header.htm');
	</script>
</body>
</html>

4. Test main page

5. Download this Source code

Download

Tags:

Bookmark  

 

One Response to “Include file Header Footer through jQuery”

  1. M.J. Evers says:

    Thanks for this code. I implemented it to make my drop-down menu as a included page but discovered it only worked in Mozilla and not in IE8. Can anyone tell me why?

Leave a Reply

Security Code:

 

  Random Post