<html?xmlns="http://www.w3.org/1999/xhtml">
????<head>
????????<title>cookie插件</title>
????????<link?href="style.css"?rel="stylesheet"?type="text/css"?/>
????????<script?type="text/javascript"?src="http://idcbgp.cn/data/jquery-1.8.2.min.js"></script>
????????<script?src="http://idcbgp.cn/data/jquery.cookie.js"?type="text/javascript"></script>
????</head>
????
????<body>
????????<div?id="divtest">
????????????<div?class="title">
????????????????<span?class="fl">cookie插件</span>?
????????????????<span?class="fr">
????????????????????<input?id="btnSet"?type="button"?value="設(shè)置"?/>
????????????????</span>
????????????</div>
????????????<div?class="content">
????????????????<span?class="fl">郵箱:</span><br?/>
????????????????<input?id="email"?name="email"?type="text"?/><br?/>
????????????????<input?id="chksave"?type="checkbox"?/>是否保存郵箱
????????????</div>
????????</div>
????????
????????<script?type="text/javascript">
????????????$(function?()?{
????????????????if?($.cookie("email"))?{
????????????????????$("#email").val($.cookie('email'));
????????????????}
????????????????$("#btnSet").bind("click",?function?()?{
????????????????????if?($("#chksave").is(":checked"))?{
????????????????????????$.cookie('email',$('#email').val(),{
????????????????????????????path:?"/",?expires:?7
????????????????????????})
????????????????????}
????????????????????else?{
????????????????????????$.cookie('email',null,?{
????????????????????????????path:?"/"
????????????????????????})
????????????????????}
????????????????});
????????????});
????????</script>
????</body>
</html>
2018-05-23
chrome不支持js在本地操作cookie!換成IE測(cè)試成功。
2017-11-02
自己電腦用ie8試了下可以
2017-09-26
同樣本地不行,那基本沒(méi)什么用處
2017-09-19