title: how to retrieve data from database without refreshing page using ajax
body: <p>i having a drop down box, it have two client(ex:client a,client b),i have more then 2000 data in each client table ,when selecting client i want to retrieve all data from database and show it in front end with out refreshing,now i am refresh  <code>window.location</code> this refresh the page.can any one help me how to do that thanks</p>
  
  <p><strong>Ajax</strong></p>
  
  <pre><code>&lt;script&gt;
  $(function() {    document.ready
      $("#client").on("change", function() {
          var ID=$(this).attr('id');
          var clientid=$("#client").val();
          $.ajax({
  
              type: "POST",
              data: {
                  clientselect: $(this).val()
              },
              success: function(data) {
                  $("#display").html(data);
                  window.location = '?action=clientnetworkpricelist&amp;clientid='+clientid+'';
                  $("#flash").hide();
              }
          });
      });
  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Select Box</p>
  
  <pre><code> &lt;select name="client" id="client" style="margin:-24px 0 0 1px;background-color:#E8E8E8;width:104px;position: absolute;"&gt; 
     &lt;option value=""&gt;Select Client&lt;/option&gt;
  &lt;?php
  
  $sql=mysql_query("select * from client_list");
  
  $clientid=$_GET['clientid'];
  
  
  
  while($row=mysql_fetch_assoc($sql))
  
  {
  
  
      if(strlen($_GET['clientid'])&gt;0 &amp;&amp; $_GET['clientid']==$row['clientid']){
      print' &lt;option id="client" name="client" value="'.$row['clientid'].'" selected&gt;'.$row['clientid'].' &lt;/option&gt;';}
  
      else{
  
              print' &lt;option id="client" name="client" value="'.$row['clientid'].'" &gt;'.$row['clientid'].' &lt;/option&gt;';
      }
  
     }
  
  
  
     ?&gt;
  
  
  &lt;/select&gt;
  </code></pre>