This is my first mobile application written in HTML5 + JavaScript with sqlite db. This is a login form: OK if user/pass is correct so I can land to 'main-page'.
I test locally with Firefox and Chrome, and it's all fine, then I use Intel XDK, running with USB connected in device (not remote), and it's still ok; but when I build with Intel XDK, install in my device, the login fails! I try to build in Phonegap, but it fails too. I don't know why, so please help.
var selectUserPass = "SELECT count(*) as ada FROM user2 where user=? and pass=?";
...
function masuk()
{
var user1 = $('#user-login').val();
var pass1 = $('#pass-login').val();
db.transaction(function (tx) {
tx.executeSql(selectUserPass, [user1,pass1], function (tx, result) {
dataset = result.rows;
item = dataset.item(0);
if (item['ada']>0) location.href="periksa.html";
//return false;
});
});
}
$(document).ready(function(){
$("#masuk").click(function(){
masuk();
});
});
<input type="text" id="user-login" name="login-email" autocomplete="off" class="form-control input-lg" placeholder="Username" />
<input type="password" id="pass-login" name="login-password" class="form-control input-lg" placeholder="Password" />
<button type="submit" id="masuk" class="btn btn-sm btn-primary"><i class="fa fa-check-circle"></i> MASUK </button>