javascript - PhoneGap redirect to login after load -


i'm running code below check if user still has session id when app opened. if not, want redirect login page. problem is, intense flickering. if change document.ready splash screen stays there forever without ever loading app. how can correctly this?

$(window).load(function(){     if(!localstorage.getitem("sessionid2")){         window.location = "login.html";     } }); 

why not put in ondeviceready?

also best practise keeping on 1 page, rather redirecting html page losing js variables.


Comments

Popular posts from this blog

Java sticky instances of class com.mysql.jdbc.Field aggregating -