以下是我成功登录我的Android应用后打开home.html页面的代码。但是,当我单击“登录”按钮时,它将加载相同的index.html页(未打开home.html)。
function check(form) {
//the following code checkes whether the entered userid and password are matching
if(form.password.value == "moleac123") {
if(form.remember_me.checked) {
window.localStorage["password_remember"] = "moleac123";
var date_to_remember = new Date().getTime();
window.localStorage["date_remember"] = date_to_remember.toString();
}
$.mobile.pageLoadErrorMessage = "";
// window.open('home.html'); //opens the target page while Id & password matches
window.location="home.html";
}
else {
alert("Invalid Password"); //displays error message
$.mobile.pageLoadErrorMessage = "";
// window.open('index.html');
window.location="index.html";
}
}
Run Code Online (Sandbox Code Playgroud)
我在logcat上收到以下错误。(请注意,我的查询移动版本为1.3.2,并且我尝试升级到1.4.5仍然发生相同的问题)
Error:
D/JsMessageQueue? Set native->JS mode to null D/CordovaWebViewImpl? onPageDidNavigate(file:///android_asset/www/home.html)
W/BindingManager? Cannot call …Run Code Online (Sandbox Code Playgroud)