Rumah > Soal Jawab > teks badan
大家讲道理2017-04-10 12:45:24
无官方支持,有插件实现。
比如:https://github.com/carhartl/jquery-co...
创建 cookie:
$.cookie('the_cookie', 'the_value');
创建有效期7天的 cookie:
$.cookie('the_cookie', 'the_value', { expires: 7 });
创建有效期7天的整站 cookie:
$.cookie('the_cookie', 'the_value', { expires: 7, path: '/' });
读取 cookie:
$.cookie('the_cookie'); // => "the_value" $.cookie('not_existing'); // => null
删除 cookie:
// cookie 存在是返回 true,否则返回 false $.removeCookie('the_cookie'); // path 路径要和创建的时候一致 $.removeCookie('the_cookie', { path: '/' });
PHPz2017-04-10 12:45:24
dojox.storage
支持cookies、local storage、session storage、application storage