gpt4 book ai didi

javascript - 用于访问下一个 html 页面的静态 4 位密码

转载 作者:行者123 更新时间:2023-11-28 20:30:36 26 4
gpt4 key购买 nike

我在谷歌上搜索过,试图找到做过我想做的事情的人,但似乎找不到任何东西,我想也许我只是没有以正确的方式陈述我想要的东西。

无论如何...

我有一个使用 PhoneGap 创建的 iPad 应用程序,它是一个简单的离线表单应用程序,它由三个 html 页面组成。我想实现的是从第 2 页到第 3 页,假设用户在单击下一页 anchor 标记按钮时需要输入一个 4 位代码,如果他们得到不正确的代码,所有发生的事情就是它不会移动到下一页,如果他们做对了,他们将继续到下一页,就这么简单。只有一个正确的代码,例如,用户无需注册并拥有用户名和密码。

我很高兴使用 html5、javascript、jquery。

如果这可行,我有什么想法吗?我会怎么做?

最佳答案

我知道注意 iPad 开发或 phonegap,但你不能这样做吗:

<script>
if(prompt("What is the number?") == "1234") { // Prompt for a number, check if its correct
window.location.href = "/thenextpage.html"; // redirect them if it is
}
</script>

或者:

<form name="myform" action="newpage.html"><input name="number"/></form>
<script>
jQuery('[name=myform]').submit(
function(evt) {
// get the number from the form
var numberVal = jQuery(evt.target).find('[name=number]').val();

// Check the number's correct
if(numberVal != "1234") {
evt.preventDefault(); // Stop the form submitting
}
}
);
</script>

如有误会请见谅

关于javascript - 用于访问下一个 html 页面的静态 4 位密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12265890/

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