title: JQuery Mobile - POST a form and get response
body: <p>Greetings,</p>
  
  <p>I have the following jquery mobile page:</p>
  
  <pre><code>&lt;div data-role="content"&gt;
      &lt;center&gt;
      &lt;img src="./images/logo320.png" /&gt;
      &lt;/center&gt;
  
      &lt;br&gt;&lt;br&gt;
  
      &lt;form method="POST" action="./ajax/login.php"&gt;
        &lt;label for="login_unameLabel"&gt;Username:&lt;/label&gt;&lt;br&gt;
        &lt;input type="text" name="login_uname" id="login_uname" /&gt;&lt;br&gt;
  
        &lt;label for="login_pwordLabel"&gt;Password:&lt;/label&gt;&lt;br&gt;  
        &lt;input type="password" name="login_pword" id="login_pword" /&gt;&lt;br&gt;
  
        &lt;button id="login_submit" type="submit" data-theme="a"&gt;Submit&lt;/button&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>./ajax/login.php returns either "OK" or "NOK". How can I capture this result in my page?</p>
  
  <p>I keep getting the following error in Firebug:</p>
  
  <blockquote>
    <p>k.data( [Break On This Error]
    false)a.mobile.activePage=k;h(k);y&amp;&amp;D&amp;...dd(k).removeClass("
    out in reverse "+</p>
  </blockquote>
  
  <p>It's as if jquery mobile is performing some operation on the result? I don't want this to happen. Do I <em>have</em> to return a valid jquery mobile HTML page from my PHP?</p>
  
  <p>Any insight greatly appreciated.</p>
  
  <p>Many thanks in advance,</p>
  
  <p>Solution: use <code>&lt;input type="button" id="login_submit" data-theme="a" value="Submit" /&gt;</code></p>
  
  <p>Now I can capture click events via:</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function() {
    $("#login_submit").click(function() {
      alert('clicked');
    });
  });
  &lt;/script&gt;
  </code></pre>