我有一个形式的搜索,与更多的选择,复选框,输入(JQuery UI)。
如何通过cookie保存所选择的元素,在按下提交的压力后,我可以更改一个值,但不能重新选择所有内容?
发布于 2012-01-21 19:09:56
如果您想使用cookies,可以使用https://github.com/carhartl/jquery-cookie中的jQuery cookies插件
Create session cookie:
$.cookie('the_cookie', 'the_value');
Create expiring cookie, 7 days from then:
$.cookie('the_cookie', 'the_value', { expires: 7 });
Create expiring cookie, valid across entire page:
$.cookie('the_cookie', 'the_value', { expires: 7, path: '/' });
Read cookie:
$.cookie('the_cookie'); // => 'the_value'
$.cookie('not_existing'); // => null
Delete cookie by passing null as value:
$.cookie('the_cookie', null);https://stackoverflow.com/questions/8952485
复制相似问题