Many time you need to refresh your page without reloading the whole page.
Some time you need it to be done automatically after a certain time.
You can do it by ajax and jquery.
Here i am writing a function which will refresh div after 10 sec.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
<script type="text/javascript">
var refreshPage = setInterval(
function () {
$('#refreshDiv').load('php_test_page2.php');
}, 10000); // refresh every 10 second
</script>
Here refreshdiv is id of the div you want to refresh.
This is the basic example that can used for advance purpose according to the need like you want to hide of show div or any other thing you may want.
0 Comment(s)