Home

Tuesday, May 3, 2011

Auto Load and Refresh Div every 10 Seconds with jQuery.

<script src="js/jquery.js"></script>

INDEX.PHP
<script>
var auto_refresh = setInterval(
function()
{
$('#load_chat').fadeOut('slow').load('chatdetails.php').fadeIn("slow");
}, 10000);
</script>
 <div style="display: block;" id="load_chat">Hi This is Testing...</div> 

chatdetails.php
<?php
$sql = mysql_query("Select id form Messages");
$record_count=mysql_num_rows($sql);
echo $record_count;
?>

No comments:

Post a Comment

rathoddhirendra.blogspot.com-Google pagerank and Worth