Hello,
I have developed an app and all works fine on android but there is a problem trying to run the app on windows mobile (emulator). Th problem seems to be with localStorage as any attemp to either get or set data does nothing!
The code below runs onLoad of the index.html and is supposed to check if the user is logged in or not to the system. To do so, checks a localStorage varable and creats the appropriate elements to put into a div.
document.addEventListener("deviceready", onDeviceReady2, false);
function onDeviceReady2() {
document.addEventListener("backbutton", onBackKeyDown2, false);
//Check if logged in or not and show appropriate button
alert (window.localStorage.getItem("isConnect"));
if (window.localStorage.getItem("isConnect") == "true") {
document.getElementById("connectionButton").innerHTML = "Show Log out button";
} else {
document.getElementById("connectionButton").innerHTML = "Show Log in button";
}
}
The alert is just for testing and while running shows nothing! When I put alert("Something"); works fine, but anything with LocalStorage seems not to be running.
Do you have any idea why this is happening (while everything runs smoothely on android)? Do I have to enable something in order to have localstorage on windows mobile?
Thanks in advance for your time and your help.