title: How do I get jQuery Mobile to redirect to a  new page?
body: <p>I'm trying to use Jquery Mobile for a web-app, and depending on what button the user clicks, redirect them to a new web page.</p>
  
  <p>Example:</p>
  
  <p>A user visits <code>foo.com/index.php</code>.</p>
  
  <p>When they click login it takes them to <code>foo.com/login.php</code>.</p>
  
  <p>That much I've been able to figure out using:</p>
  
  <pre><code>&lt;a class="ui-block-a" data-role="button" type="submit" onclick="window.location.replace('./login.php');"&gt;Login&lt;/a&gt;`
  </code></pre>
  
  <p>When I try setting <code>href</code> to <code>"./login.php"</code>, it sends me to <code>foo.com/#./login.php</code>.</p>
  
  <p>That is all well and good, but the web browser is really going to:</p>
  
  <pre><code>foo.com/index.php
  foo.com/index.php#undefined
  foo.com/login.php
  </code></pre>
  
  <p>which is causing a problem because the user has to click the back button twice. </p>
  
  <p>How can I send the user from <code>index.php</code> to <code>login.php</code> without the browser trying to go to <code>#undefined</code> first?</p>
  
  <p>I also tried:</p>
  
  <pre><code>&lt;a class="ui-block-a" data-role="button" type="submit" onclick="window.location.replace('./login.php');" href=""&gt;Login&lt;/a&gt;
  </code></pre>
  
  <p>but it still sends the viewer to <code>foo.com/index.php#</code> before redirecting properly.</p>