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  

 

2 Responses 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?

  2. syed says:

    Initially it worked with firefox, then when i updated the jquery wit the latest version it worked in ie.

    But still not functioning in chrome, let me now the solution…

Leave a Reply

Security Code:

 

  Random Post