title: window.location.href inserts new page inside of current page
body: <p>New to JavaScript. I have an AJAX function that ultimately is intended to navigate to a new URL. However, instead of the new page appearing as if the user had typed the URL themselves, the new page is sort of 'inserte' inside the same div of the button that launched the script via its onclick handler. The line in question is this:</p>
  
  <pre><code>window.location.href("newpage.html");
  </code></pre>
  
  <p>What I want is the old page to be replaced by the new page and the old page to be retained in the browsing history.</p>
  
  <p>Note that this script is called by a button inside of a form. I can show the whole code if it is helpful.</p>
  
  <p>Thanks!</p>