| 12345678910111213141516171819202122232425262728293031323334353637 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title></title>
- <script src="./js/jquery.min.js?v=2.1.4"></script>
- <script src="./js/jquery.cookie.js"></script>
- </head>
- <body>
- <p>
- 信息记录:<input type="text" id="msg" value="" />
- <input type="text" id="msgs" value="" />
- <input type="button" value="记住当前信息" id="sure" />
- </p>
- <script type="text/javascript">
- $(function () {
- if($.cookie("username"))
- {
- $("#msg").val($.cookie("msg"));
- $("#msgs").val($.cookie("msg"));
-
- }
-
- $("#sure").click(function () {
- $.cookie("msg", $("#msg").val(), {path: "/", expires: 7,secure:true});
- $.cookie("msg", $("#msgs").val(), {path: "/", expires: 7,secure:true});
-
- })
- })
- </script>
- </body>
- </html>
|