Refreshing a particular div

With the evolving and more dynamic web application. Refreshing particular part of the page is very much required. Recommended ads on Facebook use it. When we click on like ad, it sends the server tag of the ad the server recommends you another ad. The use of it I can think of is for Views. Create a view of different object on your page and call them using load method.

Required: jquery-latest.js

Using:

<script type="text/javascript" src="jquery-1.6.js">
</script>
<script type="text/html">
      $('#newcontent').load('file2.php');
</script>
Explanation:
       # is selector for id which is newcontent, a div here. Load method loads the content of file2.php in newcontent div.
Advertisements