title: loading url with ajax and jquery for each item
body: <p>If I am using ajax and jquery to view something from database , this will happen behind the scenes . Alright ? but If I want to use ajax,jquery and make changes in the url . How can that happen ? 
  For example : I am viewing news in the site ,,how can I make a unique url for each news to be accessed or shared by the user,,although it is working behind the scenes ? </p>
  
  <p>ajax</p>
  
  <pre><code>$(document).ready(function(){
      $(document).on('click','#see',function(){
          var ID = $("#rowid").val();
          var er = "_|_";
  
          $.ajax({
              type:'POST',
              url:'news.php',
              data:'var='+ID,
              success:function(response){  
          //     history.pushState('data', '', 'news.php?var='+ID);
               window.location.href = "news.php?var="+ID;   
              }
          }); 
      });
  });
  </code></pre>
  
  <p>php</p>
  
  <pre><code>       &lt;script src="https://code.jquery.com/jquery-1.12.4.js"&gt;&lt;/script&gt;
          &lt;script src="script.js"&gt;&lt;/script&gt;
  
  &lt;?php
   error_reporting(0);
  include("../icac/includes/db-connect.php");
   mysqli_query($con,"set names 'utf8'");
  $query="SELECT * FROM `icac_content_tbl` LIMIT 1";
  $result= mysqli_query($con,$query);
  while($row=mysqli_fetch_array($result)){ ?&gt;
  
  &lt;h1&gt;&lt;input id="rowid" type="hidden" value="&lt;?php echo $row["content_title"]; ?&gt;"/&gt;&lt;/h1&gt;
  
  &lt;a href="javascript:void(0)" id="see"&gt;see link&lt;/a&gt;
  &lt;h2&gt;&lt;?php    if( $row["content_title"] == $_GET["var"]) { echo $row["content_title"];
  
      echo "&lt;br&gt;"; echo $row["content_body"];
      ;}  ?&gt;&lt;/h2&gt;
  &lt;?php
  }
  ?&gt;
  </code></pre>