zoukankan      html  css  js  c++  java
  • cookie.js插件的案例

      cookie.js插件的案例:

      https://github.com/jaywcjlove/cookie.js/blob/master/README.md    文档  api   在这里即可查看用法

      <!DOCTYPE html>
      <html>
        <head>
          <meta charset="UTF-8">
          <title></title>
          <script src="../js/cookie.js"></script>
        </head>
        <body>
          名字:<input type="text" name="name" id="name" /><br />
          密码:<input type="text" name="pass" id="pass" /><br />
          <button id="cun">存cookie</button><br />
          <button id="huo">获cookie</button><br />
          <button id="shan">删cookie</button><br />
        </body>
      </html>
      <script>
        function $(id){
          return document.getElementById(id);
        }
        $("cun").onclick=function(){
          var uname=$("name").value;
          var pass=$("pass").value;
          cookie('name',uname,1);
          cookie('pass',pass,1);
        }
        $("huo").onclick=function(){
          alert(document.cookie);
        }
        $("shan").onclick=function(){
          cookie.clear()
        }
      </script>

  • 相关阅读:
    重回大一
    20071027我以为我很大度
    凌晨三点
    山洞爱情
    JQuery上传插件Uploadify使用详解
    jquery ui layout
    win2003下direct的问题
    Aptana一些快键用法
    IE、Firefox、Chrome 的JS代码兼容注意事项
    2011学习计划
  • 原文地址:https://www.cnblogs.com/shangjun6/p/10719160.html
Copyright © 2011-2022 走看看