title: Using ajax, how to get notify only if there is any update in the received data
body: <pre><code>$(document).ready(function refreshText(){
  $.ajax({ 
          type: "POST",
          url: "user.php",
          data: "data1=1",
          success: function(result){
           $(".msg").html(result);
           setTimeout(refreshText, 5000);
           }});
      });
  </code></pre>
  
  <p>Initially when it loads it should not notify or alert, but after every timeout it should alert me if there is any update in the data..Exactly how it works in chat. Could any one please help me on this, I am bit new to programming....</p>