gpt4 book ai didi

javascript - 我怎样才能强制网络用户在继续之前阅读和检查 NDA?

转载 作者:可可西里 更新时间:2023-11-01 02:53:49 25 4
gpt4 key购买 nike

每次用户注册到我们的网站时,我们都需要出示 NDA(保密协议(protocol))。为了继续,用户必须接受它。我的问题是我在所有一页中都有保密协议(protocol),但用户并没有真正阅读并接受(就像我们所有人一样)。

我想要的是确保用户阅读 NDA 并在他“阅读”它时接受它?

如果用户选中一个框并单击接受,我现在拥有的是一个简单的 jQuery 验证。然后进入下一页。

这是我的

<script>
$(document).ready(function() {
$('#go').click(function() {
// check if checkbox is check and go to next page
// i have this code
});
});
</script>
<div>
full nda
<hr>
<input type=checkbox> <input type=button value=go id=go>
</div>

我已经有了复选框和按钮的代码

我只是不想让用户盲目接受保密协议(protocol)

谢谢

最佳答案

如果你想阻止用户找到“我同意复选框”并以正确的方式提交按钮,你必须隐藏它,然后在他阅读最后一页后显示这些输入。

这是您可以使用的示例脚本。这会在您滚动页面时加载条款,并在最后一个页面添加一个复选框和提交按钮。

确保页面足够长,因此您必须滚动并使用 .live 事件(因为加载页面时复选框和输入按钮不存在)

// main page
<script>
function getTC() {
var id = $(".paragraph:last").attr("id").replace('tnc', '');
if((parseInt(id) + 1) > 10) {
return;
}
$.post("terms.php?paragraph=" + id, function(r) {
$('#terms').append(r);
});
}

$(document).ready(function() {
$(window).scroll(function(){
if($(window).scrollTop() == $(document).height() - $(window).height()) {
getTC();
}
});

// logic for checkbox & submit using .live

});
</script>

<div id="terms">
<div class="paragraph" id="tnc1">
Lorem ipsum dolor sit amet ...
</div>
<div class="paragraph" id="tnc2">
Lorem ipsum dolor sit amet ...
</div>
<div class="paragraph" id="tnc3">
Lorem ipsum dolor sit amet ...
</div>
<div class="paragraph" id="tnc4">
Lorem ipsum dolor sit amet ...
</div>
</div>

// php
<?php

// add security here

if(!isset($_GET['paragraph'])) {
$_GET['paragraph'] = '1';
}
$_GET['paragraph'] = (int)$_GET['paragraph'] + 1;

if($_GET['paragraph'] <= 10) {
?>
<div class="paragraph" id="tnc<?php echo $_GET['paragraph'] ;?>">
Lorem ipsum dolor sit amet ...
</div>
<?php
if($_GET['paragraph'] == 10) {
echo '<hr/>I agree with the terms and conditions <input type="checkbox" /><input type="button" value="I accept" /><hr/>';
}
}

关于javascript - 我怎样才能强制网络用户在继续之前阅读和检查 NDA?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8108946/

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