title: PHP-AJAX: How to pass URL variable through Ajax
body: <p>I have set an Ajax call for Pagination. I need to pass one more vaiable which is stored in the URL</p>
  
  <p><strong>URL</strong></p>
  
  <pre><code>http://thisite.com/pagetitl/?id=12  **// where 'id=' is a variable I want to pass.**
  </code></pre>
  
  <p><strong>Ajax Call</strong></p>
  
  <pre><code>function page(page) {
      var dataString = '&amp;page=' + page; // pagination with ajax
      pag.ajax({
          type: "GET",
          url: "cmn_pg.php",
          data: dataString,
          success: function (ccc) {
              pag("#search_results").html(ccc);
          }
      });
  }
  </code></pre>
  
  <p>I have tried to GET it in PHP file <code>$id=$_GET[id]</code>, but wont work.</p>
  
  <p>I ask how to pass it with AJAX because I'm quite new to AJAX.</p>