gpt4 book ai didi

带有 cookie 的 jQuery 选项卡 - 如果 cookie 存在?

转载 作者:行者123 更新时间:2023-12-03 23:04:50 26 4
gpt4 key购买 nike

我有这个代码:

jQuery(document).ready(function($) {
$( "#tabs" ).tabs({
collapsible: true,
fx: { height: 'toggle', duration: 'fast'},
cookie: { expires: 30 }
});
});

我使用带有 cookie 集的 jQuery 选项卡。如果没有设置 cookie,我想隐藏选项卡。我安装了所需的 jquery.cookie 插件。

我的问题

如何检查选项卡 cookie 是否已设置?

最佳答案

你不能使用 cookie.js 中的 getter 方法来做到这一点吗:

* Get the value of a cookie with the given key.
*
* @example $.cookie('the_cookie');
* @desc Get the value of a cookie.
*
* @param String key The key of the cookie.
* @return The value of the cookie.
* @type String

类似于

var cookieVal = $.cookie('ui-tabs-1');

关于带有 cookie 的 jQuery 选项卡 - 如果 cookie 存在?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7804217/

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