title: javascript redirect not working anyway
body: <p>There are many same questions here. I tried all solutions - nothing helps.</p>
  
  <p>I want to open new page in some tab with javascript. Here is my HTML:</p>
  
  <pre><code>&lt;head&gt;
  &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" &gt;&lt;/script&gt;
  &lt;script src="functions.js"&gt;&lt;/script&gt;
  
  &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
  &lt;title&gt;Untitled Document&lt;/title&gt;
  &lt;link href="css.css" rel="stylesheet" type="text/css" /&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  ...
  &lt;label&gt;
  &lt;input type="image" name="imageField" id="loginClient" onclick="testUrl()" src="images/index_33.gif" /&gt;
  &lt;/label&gt;
  ...
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here is my functions.js:</p>
  
  <pre><code>function testUrl()
  {
  
  window.location = "content.html";
  
  }
  
  function loginClient()
  ...//more functions
  </code></pre>
  
  <p>I tried other ways too:</p>
  
  <pre><code>window.location.replace("content.html")
  
  top.location="content.html"
  
  window.location.assign("content.html")
  
  window.open("content.html", "_self")
  
  window.location.href="content.html"
  
  window.event.returnValue = false;
  window.location = "content.html";
  
  setTimeout(function(){window.location.assign("content.html");return false;},500)
  </code></pre>
  
  <p>nothing works, I tried it in Opera, Firefox (all in Windows) and Chrome (Debian).
  BUT it works if I set:</p>
  
  <pre><code>window.open("content.html")
  </code></pre>
  
  <p>but in new tab, isn't solution, I need it in same tab.</p>
  
  <p>BUT if I try to debug it with Firebug and click always "Step into" than all solution work. And if I set alert() before redirecting, it works too.</p>
  
  <p>Console shows no errors.
  I have no idea, help.</p>
  
  <p>RESOLVED: Thanks to @lonesomeday!</p>
  
  <p>this is the solution:</p>
  
  <pre><code>$(document).ready(function(){
      $("#loginClient").click(function(event){
        event.preventDefault();
        window.location = "content.html";
      });
  });
  </code></pre>