setIntervall without multiply
I'm doing a chat using prepend() into a setInterval();
Code:
- setInterval(function(){
- $.post("ajax/compartilhamentos.php",function(data){
- $(".compartilhamentos").prepend(data);
- });
- }, 5000);
the problem is that if something has already been loaded I do not want it to load again, and so just prepend new "data".
does anyone know how ?