Jquery Cookie操作
// 写入
$.cookie('the_cookie','the_value');
// 读取
$.cookie('the_cookie');
// 删除
$.cookie('the_cookie',null)
例子
<script src="js/jquery.cookie.js"></script>
</script>
<script>
$(function(){
var COOKIE_NAME='username';
if($.cookie(COOKIE_NAME)){
$("#username").val($.cookie(COOKIE_NAME));
}
$("#check").click(function(){
if(this.checked){
$.cookie(COOKIE_NAME,$("#username").val(),{path:'/',expires:10});
}else{
$.cookie(COOKIE_NAME,null,{path:'/'});
}
})
})
</script>