简易的JQuery设置Cookie
2015-11-09 09:57
531 查看
使用之前先引用这两个文件:
然后基本的功能代码如下:
更多详细内容,请参考: http://www.helloweba.com/view-blog-86.html
然后基本的功能代码如下:
<div> <input id="txtDelValues" type="text" /> <input id="Button1" type="button" onclick="SetCookie();" value="设置cookie" /> <input id="Button2" type="button" onclick="javascript: alert(GetCookie());" value="显示cookie" /> <input id="Button3" onclick="DelCookie()" type="button" value="删除cookie" /> </div> <script type="text/javascript"> //设置COOKIE function SetCookie() { $.cookie("test", $('#txtDelValues').val()); } //读取Cookie function GetCookie() { if ($.cookie('test') != null) { var res = $.cookie('test'); return res; } else { return null; } } //删除Cookie function DelCookie() { $.cookie('test', null); } </script>
更多详细内容,请参考: http://www.helloweba.com/view-blog-86.html
相关文章推荐
- JQuery
- jQuery的插件的写法
- jquery zTree 入门,从后台获取数据
- 一、jQuery选择器
- jQuery学习实例:焦点图轮播特效
- 重写jquery.confirm.js 摆脱传统alert confirm 插件供下载(三)
- jquery中attr和prop的区别分析
- AJAX在jQuery中使用步骤
- Jquery选择器(二)
- jquery实现网页中常见的展示列表效果
- jquery
- Jquery的常见属性
- Jquery 获取checkbox的checked问题
- jquery 侧边导航
- Jquery选择器(一)
- jquery简单的选项卡
- DOM 与Jquery模拟表单提交
- jquery实现简易的移动端验证表单
- android studio下phonegap+jquerymobile hybird开发
- jquery实现本站收藏