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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.