2
Well personal I have a script to request ajax every 1 second to show me new content but now I’m having a problem that it every 1 second updates me all the content I wanted that only shows up if there is new content in the database.
The script I’m using and this
<script>
//LISTA POSTS ESTABELECIMENTOS
$(document).ready(function() {
$.ajaxSetup({ cache: false }); // This part addresses an IE bug. without it, IE will only load the first number and will never refresh
setInterval(function() {
$('#mostra_posts').load('ajax/mostra_posts.php?id_estabelecimento=<?php echo $row->id; ?>');
}, 1000); // the "3000" here refers to the time to refresh the div. it is in milliseconds.
});
// ]]>
</script>
I wonder how I can make use of this script.
If you want the right way/recommended/rapido http://www.html5rocks.com/en/tutorials/websockets/basics/
– Isvaldo Fernandes
You have to know on the server that the content has changed?
– bfavaretto