title: how to load data without page refresh using ajax
body: <p>Here is my code for loading data </p>
  
  <pre><code>$(document).ready(function() {         
      $.get('get-answers.php', { 
          project_question_id: &lt;?=$project_question_id?&gt;,
          project_id: &lt;?=$project_id?&gt;
      }, function(data) {
          $('#dispaly-answers').append(data);
      });  
  });
  </code></pre>
  
  <p>This code  retrieves data from database and working fine. But problem here is that if I add new data on the database, this data doesn't show up without page refresh. 
  So I don’t want to refresh the page to get the data. It should be displayed once new data added to database. 
  Any suggestions on this issue? 
  P.S : I also tried .ajax(), didn’t work. </p>
  
  <p>Here is my $.ajax() request
  $(document).ready(function() {</p>
  
  <pre><code> $.ajax( {
  type: "GET",                 
  url: "get-answers.php",                 
  data: { project_question_id: &lt;?=$project_question_id?&gt;,
          project_id: &lt;?=$project_id?&gt;
          },
  cache: false,                  
  
    success: function(data) {   
    $('#dispaly-answers').append(data);                      
  
             },// success                 
  
      })// ajax   
  
  });
  </code></pre>
  
  <p>Does the same as $.get() </p>