-1

Web サイトにコードを追加しましたが、Cookie 機能を追加する方法がわかりません これまでのコードは次のとおりです。

<script type="text/javascript">
$(document).ready(function () {
    $.fancybox('<p class="msgAlert">The following pictures contain nudity. <br />If you are not allowed or willing to watch such content please leave this page.<p><a href="javascript:void(0);" id="do_accept" class="button butgreen">Yes I Accept</a></p></p>', {
        closeBtn: false,
        closeClick: false,
        helpers: {
            overlay: {
                css: {
                    'background': 'rgba(0, 0, 0, 0.9)'
                }
            }
        }
    });
    $("body").on("click", "#do_accept", function () {

        $.fancybox.close();
    });
    $("body").on("click", ".fancybox-overlay", function () {
        window.location.href = "index.php";
    });

});
</script>

PHPコードを追加できないので、アドバイスが必要です。アイデアは、メッセージを 10 日に 1 回だけ表示するために、10 日間の Cookie を持つことです。リンクはこちら: https://www.olafernst.com/photo/gallerynudes.html どうも ありがとう

4

1 に答える 1