how can i auto refresh the div in a particular page
| SitePoint Sponsor |
how can i auto refresh the div in a particular page


You can update individual parts of a page without refreshing the rest of the page using javascript/Ajax.
If you want to auto refresh it, you can just create a timed loop in javascript. There's a function called setInterval() that allows you to do something like this.
If you're using jQuery:
where #refresh is the element you want to refresh.Code:setInterval(function() { $("#refresh").load(location.href+" #refresh>*",""); }, 10000); // seconds to wait, miliseconds
Martin.


Yeah mart - but that's actually using jquery, not pure javascript.
In order for the above code to work, you'll need to include the jquery library.


Bookmarks