<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>

相关文章:

  • 2021-09-07
  • 2022-02-10
  • 2022-12-23
  • 2021-10-10
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-04-24
  • 2021-06-13
  • 2022-01-23
相关资源
相似解决方案