title: JQuery and AJAX update page data without refreshing page and only updating not-already-present data
body: <p>I read a question and <a href="https://stackoverflow.com/questions/22577457/update-data-on-a-page-without-refreshing/22577520#22577520">this was the answer</a>:</p>
  
  <blockquote>
    <p>You can read about Jquery Ajax from official jquery Site:</p>
    
    <p>Site Link - ><a href="https://api.jquery.com/jQuery.ajax/" rel="nofollow noreferrer">https://api.jquery.com/jQuery.ajax/</a></p>
    
    <p>If you don't want to use any click event then you can set timer for
    periodically update.</p>
    
    <p>Below code may be help you just example.</p>
  
  <pre><code>function update() {
  $.get("response.php", function(data) {
  $("#some_div").html(data);
  window.setTimeout(update, 10000);
    });
  }
  </code></pre>
    
    <p>Above function will call after every 10 seconds and get content from
    response.php and update in #some_div...</p>
  </blockquote>
  
  <p>Now I am making a chat website. Simple. But if let's say there have been 200 msgs sent from the beginning of the conversation. If I renew the whole of the chat data everytime, it will have to write the 200 msgs again and will then write the 1 new msg i.e. the two hundred and first message. What I mean is that I want only the not-already-present data to be UPDATED not INSERTED.. :) hope you get what I mean. And plus, in all the questions they either used a $.get request or a load() function of jquery writing the path to a mysterious php file but never telling what on earth is in the php file :)
  plus, please don't block me for seeking help as I was last time :'( It was heart-breaking really to be kicked off such an awesome community :)</p>