Why this does not work ?
if(typeof(localStorage.getItem("username"))=='undefined'){
alert('no');
};
The goal is to redirect the user from the index page to the login page if not already logged.
Here the localStorage.getItem("username"))
variable is not defined for the moment.
It's for an ios phonegap app.