gpt4 book ai didi

javascript - 如何重定向到phonegap iphone中的本地html页面

转载 作者:行者123 更新时间:2023-11-28 20:01:57 31 4
gpt4 key购买 nike

我在 coredova 中开发混合应用程序。我的场景是当用户启动应用程序时会询问登录页面。一旦用户提交凭据,我想从我的本地加载一个 html 页面,即从 xcode。我尝试了不同的方法,但它不起作用。有人建议像这样尝试提交完整路径。

这是我的 index.html

<html>
<script src="cordova-2.7.0.js"></script> <script src="js/index.js"></script>
<script language="javascript" type="text/jscript"> function DoLogin() { document.forms[0].action = "https://loginpage"; document.forms[0].submit(); } </script> <body > <formDraft

<html>
<script src="cordova-2.7.0.js"></script>
<script src="js/index.js"></script>
<script language="javascript" type="text/jscript">
function DoLogin() {
document.forms[0].action = "https://loginpage";
document.forms[0].submit();
}
</script>
<body >
<form method="post">
<h2>
Welcome ....
</h2>
<p>
Please login using Agent or Employee Id
</p>
<p>
<div>
User Name:<input type="text" id="Ecom_User_Id" style="width: 100px" name="User_ID" /><br />
Password:&x;&y;<input type="password" id="Password" style="width: 100px" name="Password" /><br />
<input type="submit" id="btnLogin" value="Login" onclick="javascipt:DoLogin();return false;" />
<input name="target" type="hidden" id="target" value="file:///www/About.html"/>
<input name="id" type="hidden" id="id" value="NLG" />
</div>
</p>
</form>
</html>

我尝试过这样的值=“About.html”,但这是不可能的,也尝试通过提供包路径但不工作。

任何人都可以帮助我。非常感谢。

提前致谢。

最佳答案

尝试

window.location.href="page2.html";

代替

window.location="page2.html"

关于javascript - 如何重定向到phonegap iphone中的本地html页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23631668/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com