jQuery怎么设置读取删除清空cookie

如题所述

在html页面,先引入jQuery文件,再引入jQuery.cookie.js的类库文件。
然后在script标签中使用方法:
$.cookie('the_cookie'); // 读取 cookie
$.cookie('the_cookie', 'the_value'); // 存储 cookie
$.cookie('the_cookie', 'the_value', { expires: 7 }); // 存储一个带7天期限的 cookie
$.cookie('the_cookie', '', { expires: -1 }); // 删除 cookie
温馨提示:答案为网友推荐,仅供参考
相似回答