title: How to store program state in URL query string?
body: <p>How do I read, <em>and write</em>, to the query string?</p>
  
  <pre><code>var pageNumber = QueryString['pageNumber'];
  var pageSize   = QueryString['pageSize'];
  
  $('#next').click(function() { 
      QueryString['pageNumber'] = ++pageNumber;
      refresh(); 
  });
  
  function refresh() { /** get data and update page here **/ }
  </code></pre>
  
  <p>This, of course, will allow users to copy and paste URLs that contain partial program state.</p>
  
  <p>Is there an API similar to <code>QueryString</code> (used above)?</p>