i am developing a simple Hybrid application in IBM Worklight using DOJO.I have a Login Page and a Welcome Page. Once i press the login button it will go to function to check whether credentials are correct,if it is correct i want to mo to Welcome Page.
My code.. HTML
...
..
<button data-dojo-type="dojox.mobile.Button" id="loginBtn"
style="margin-left: 50%; margin-top: 3%"
data-dojo-props="label:'Login', onClick:function(e){loginCheck();}"></button>
...
..
.JS
. .. function loginCheck() { var username = uname.value; var password = pass.value;
if(username == "admin" && password == "admin")
{
//Move to another view
}
else
{
alert("Incorrect Username or Password");
}
} .. ..
Any help is appreciated..
I use this code and it works
Don't use alert, use this :