Chat Ajax Load

Chat Ajax Load

I want a chat and I used:

  1. var tempoCompartilhamentos = setInterval(function(){
    $(".compartilhamentos").load("compartilhamentos.php");
    }, 5000); 

but just want to carry what's new in this chat ..

can anyone tell me how I? ty :)