title: HTML5 History API Back Button
body: <p>I'm using an ajax call to update a part of my page, it's for a search function. When I do the search, I update the url. Example: mysite.com/products becomes mysite.com/products?search=blabla</p>
  
  <p>But when I press the back button, only the url changes and not the content of the page.</p>
  
  <p>This is the function I use to set the history:</p>
  
  <pre><code>function setHistory(data, url) {
      var search = $("#Search").val();
      url = url.replace('search_input', search);
      history.pushState(data, "", url);
  }
  </code></pre>
  
  <p>The <code>data</code> is what is changed on the page and the <code>url</code> is the new url to push to the history. Is there something I'm doing wrong? Shouldn't the page update itself if I use the back button? It won't work in chrome nor in IE 10.</p>