title: How can I change the current URL?
body: <p>I have the following code that changes the pages from within JavaScript:</p>
  
  <pre><code>var newUrl = [some code to build up URL string];
  window.location.replace(newUrl);
  </code></pre>
  
  <p>But it doesn't change the top URL, so when someone clicks the back button it doesn't go back to the previous page.</p>
  
  <p>How can I have JavaScript change the top URL as well so the browser back button works.</p>