开发者

I want to use jQuery cookie, but I cant find the cookie method

What should I do, which is the best jQuery cookie 开发者_高级运维 plugin?

Thanks.


You can use the jquery-cookie plugin available at Github: https://github.com/carhartl/jquery-cookie

You can set the cookie value by:

$.cookie('cookie_name', 'cookie_value');

And get the value back by:

var cval = $.cookie('cookie_name');

And delete the cookie by:

$.cookie('cookie_name', null);


Check out:

  • Setting cookies with jQuery
  • jQuery & Cookies (get/set/delete & a plugin)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜