Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何才能.policyDiv在页面加载时显示但在重新加载时隐藏直到清除 cookie?
.policyDiv
<script type="text/javascript"> if(!$.cookie("policy")) { $.cookie("policy", "DFG Policy"); $(".policyDiv").show() } </script>
试试这个
<script type="text/javascript"> $(document).ready(function(){ if(!$.cookie("policy")) { $.cookie("policy", "DFG Policy"); $(".policyDiv").show() }else{ $(".policyDiv").hide() } }) </script>