jQuery Cookie不起作用

时间:2013-07-20 21:11:25

标签: jquery cookies

我遇到问题,我的jQuery cookie不起作用。

脚本:

    $(document).ready(function () {
    $('.close').click(function () {
        $.cookie("isHidden", "true", {
            expires: 1
        });
        $(".notice").hide();
        return false;
    });

    var hidden = $.cookie("isHidden");

    if (hidden === null) {
        $('.notice').show();
    }
});

当我删除cookie时,脚本运行正常! 还用jsfiddle.net检查 - 它说它工作正常。

0 个答案:

没有答案