title: Adding page number to jQuery generated URL
body: <p>I have a Google Instant style search script written in jQuery which queries a PHP file. &amp;d=<strong>PAGENUMBER</strong> is the result page function on the PHP file and I want to make my script have this in the URL too. Currently when a user searches, a URL is created which is something like #search/<strong>QUERY</strong>/1/. How can I make the <strong>/1/</strong> my page number?</p>
  
  <p>Here is my jQuery code:</p>
  
  <pre><code>$(document).ready(function(){
      $("#search").keyup(function(){
          var search=$(this).val();
          var query=encodeURIComponent(search);
          var yt_url='search.php?q='+query+'&amp;category=web&amp;d=1';
          window.location.hash='search/'+query+'/1/';
          document.title=$(this).val()+" - My Search Script";
          if(search==''){
              window.location.hash='';
              document.title='My Search Script';
          }
          $.ajax({
              type:"GET",
              url:yt_url,
              dataType:"html",
              success:function(response){
                  if(response !=""){
                  $("#result").html(response);
                  } else {
                  $("#result").html("Your search did not return any results");
                  }
              }
          });
      });
      if(window.location.hash.indexOf('#search/')==0){
          query=window.location.hash.replace('#search/', '').replace('/1/', '');
          $('#search').val(decodeURIComponent(query)).keyup();
      }
  });
  </code></pre>