Javascript 我在哪里可以下载 jquery cookie 插件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8704624/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 07:10:10  来源:igfitidea点击:

Where can I download the jquery cookie plugin?

javascriptjquerycookies

提问by KamalSalem

I'm trying to implement cookies in my website, I'm using jquery, but I can't find a place to download the plugin itself.

我正在尝试在我的网站中实现 cookie,我正在使用 jquery,但我找不到下载插件本身的地方。

Any ideas?

有任何想法吗?

回答by dknaack

Description

描述

You can download it on Githuband use it like this

你可以在 Github 上下载它并像这样使用它

Sample

样本

Setting a cookie

设置 cookie

$.cookie("example", "foo");

Setting with expiry time

设置过期时间

$.cookie("example", "foo", { expires: 7 });

Getting the cookie

获取 cookie

$.cookie("example")

Deleting the cookie

删除cookie

$.cookie("example", null);