title: Open new HTML page in the same tab via Javascript
body: <p>I have tried a half dozen ways to open a page in the same tab upon clicking a button and none of them work on FireFox or Edge:</p>
  
  <pre><code>window.location ="advance.html";
  </code></pre>
  
  <p>nothing happens</p>
  
  <pre><code>window.location ="/advance.html";
  </code></pre>
  
  <p>nothing happens</p>
  
  <pre><code>window.location.href ="advance.html";
  </code></pre>
  
  <p>nothing happens</p>
  
  <pre><code>window.location.href ="/advance.html";
  </code></pre>
  
  <p>nothing happens</p>
  
  <pre><code>window.open("advance.html", _self);
  </code></pre>
  
  <p>nothing happens</p>
  
  <pre><code>window.open("advance.html");
  </code></pre>
  
  <p>opens page in new tab</p>
  
  <p>Been working on it for an hour trying every suggestion and nothing works.</p>
  
  <p>What am I missing here? </p>
  
  <p><strong>EDIT:</strong>
  Since people are asking for the context (I know the username and password are in plain text, I'm just trying to get this part working first):</p>
  
  <pre><code>&lt;script language="javascript"&gt;
      function goHome()
      {
          window.location = 'index.html';
      };
  
      function login(form)
      {
          if(form.company.value == "advance" &amp;&amp; form.password.value == "1234")
          {
              window.location.href ="advance.html";
          }
          else if(form.company.value == "" || form.password.value == "")
          {
          }
          else
          {
              alert("Incorrect Usename/Password combination please try again.");
              form.password.value = "";
          }
      }
  </code></pre>