title: Simple login system for PhoneGap app
body: <p>I'm trying to build a simple login system for my PhoneGap app. I have a form where user gives a username and if there is a matching username in the MYSQL the user is redirected to another page. Else an alert is shown. The code works just fine on firefox and chrome, but when I try to use it on Safari or on the PhoneGap app it doesn't seem to work. What could be the reason?</p>
  
  <p>HTML</p>
  
  <pre><code>    &lt;form id="login-form" rel="external" data-ajax="false" &gt;
  
      &lt;label for="number"&gt;Number:&lt;/label&gt; 
      &lt;br&gt;
      &lt;input type='tel' name="number" id="number" data-corners="false" data-theme="d"/&gt;
      &lt;br&gt;
  
      &lt;label for="username"&gt;Username:&lt;/label&gt;
      &lt;br&gt;
  
      &lt;input name="username" id="username" data-corners="false" data-theme="d"/&gt;
      &lt;br&gt;
  
  &lt;input type="submit" value="OK" data-theme="b" data-corners="false" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>JS</p>
  
  <pre><code> $(function() {    
       $('#login-form').submit(function(event) {
           event.preventDefault();
  
           $.post(serviceURL +'login.php', { 
               kayttaja: $('[name="username"]').val(), 
           }).success(function(data) { 
               if (data.status == 'ok') {
                   var input = document.getElementById("number");
                   var user = document.getElementById("username");
                  localStorage.setItem("number", input.value);
                  localStorage.setItem("username", user.value);
                   window.location.pathname = data.redirect;
               } else {
                   alert(data.message);
               }
           })
       })
  }) 
  </code></pre>