Auto refresh a particular div

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:

setInterval(function() {
    $("#refresh").load(location.href+" #refresh>*","");
}, 10000); // seconds to wait, miliseconds

where #refresh is the element you want to refresh.

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.

Yes, that’s why I said “If you’re using jQuery”.

lol doh…

Must have been half asleep, because I missed that