Jquery 操作Cookie
<script src="jquery.js" type="text/javascript"></script>
<script src="jquery.cookie.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
function setcookie()
{
var dt=new Date();
dt.setTime(dt.getTime()+1*60*1000);// 设置cookie到期时间为1分钟
$.cookie('username','ni mei',{path:'/',expires:dt});//username为cookie的名字 ni mei 为值 dt为时间 path为路径
}
function getcookie()
{
alert( $.cookie('username'));//获取cookie名字为username的值
}
function cleancookie()
{
$.cookie('username',null);//删除名字为username的cookie
}
</script>