title: Difference between window.location.href, window.location.replace and window.location.assign
body: <p>What is the difference between </p>
  
  <ol>
  <li><code>window.location.href="http://example.com";</code></li>
  <li><code>window.location.replace("http://example.com");</code></li>
  <li><code>window.location.assign("http://example.com");</code></li>
  </ol>
  
  <p>I read in many forums that <code>window.location.assign()</code> just replaces the current session history and hence back button of browser will not function. However, I am not able to reproduce this. </p>
  
  <pre><code>function fnSetVariable() {
      //window.location.href = "http://example.com";
      window.location.replace("http://example.com");
      //window.location.assign("http://example.com");
  }
  
  &lt;a onmouseover="fnSetVariable();" 
     href="PageCachingByParam.aspx?id=12" &gt;
     CLICK 
  &lt;/a&gt;
  </code></pre>