Redirect javascript phonegap中的重定向
我遇到了一个问题,我尝试了一切可能的方法从我的索引页重定向到另一个.html文件。window.open、window.location、Redirect javascript phonegap中的重定向,redirect,cordova,Redirect,Cordova,我遇到了一个问题,我尝试了一切可能的方法从我的索引页重定向到另一个.html文件。window.open、window.location、window.location.href但我的URL末尾只有一个?。这是我的代码: function login() { var username = document.getElementById("username").value; var password = document.getElementById("password").value
window.location.href
但我的URL末尾只有一个?
。这是我的代码:
function login() {
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
if(username=='admin' && password=='123') {
window.location = "phonegap/menu.html";
}
else {
alert('Wrong pw or username!');
}
这是一幅结果图,包含了所有可能存在的功能。
您也可以使用下面的代码重定向,请使用live url进行测试
window.location = "https://www.google.co.in/";
var ref = window.open('http://apache.org', '_blank', 'location=yes');
window.location.href = "http://stackoverflow.com";
正如我所说,它仍然不起作用。。这些功能都不适合我。你说的实时URL是什么意思?