gpt4 book ai didi

javascript - 将表单值传递到不同页面上的另一个表单,而不使用 url 变量 (javascript)

转载 作者:行者123 更新时间:2023-11-30 23:50:55 24 4
gpt4 key购买 nike

我的页面上有一个表单,我想将表单输入框值传递到另一个页面上另一个表单上的另一个输入框,而不使用 URL 变量 - 这可能吗?

它们共享相同的标题页部分(如果有帮助的话)。

谢谢

乔纳森

最佳答案

详细说明@BoltBait - 这是一个基本示例,使用 JQuery + cookie plugin

在第一页

<script type="text/javascript">
// set the cookie, on click to the next page
$("#next-page").click(function() {
$.cookie("INPUTBOX",$("input[name=inputbox]").val());
});
</script>

下一页

<script type="text/javascript">
// get the cookie, we are now on the next page
alert($.cookie("INPUTBOX"));
</script>

希望这有帮助

关于javascript - 将表单值传递到不同页面上的另一个表单,而不使用 url 变量 (javascript),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1546500/

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