首页 > Web开发 > 详细

jquery --cookie

时间:2017-09-25 09:20:46      阅读:303      评论:0      收藏:0      [点我收藏+]
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>cookie</title>
</head>
<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script src="jquery-cookie/jquery.cookie.js"></script>
<body>
<input onkeyup="value=value.replace(/[\W]/g,‘‘) " onbeforepaste="clipboardData.setData(‘text‘,clipboardData.getData(‘text‘).replace(/[^\d]/g,‘‘))" ID="Text1" NAME="Text1">
<input onkeyup="value=value.replace(/[^\d]/g,‘‘) " onbeforepaste="clipboardData.setData(‘text‘,clipboardData.getData(‘text‘).replace(/[^\d]/g,‘‘))" ID="Text2" NAME="Text2">
<input type="text" id="intye" value="">
</body>


<script>

    $(function () {

         if($("#intye").val()==""){
           $("#intye").val($.cookie("ms"));
         }else{             
              $.cookie("ms", $("#intye").val(), {path: "/", expires: 30});  
         }

           $("#intye").keyup(function(){

                  if($("#intye").val()==""){


                   }else{
                       
                        $.cookie("ms", $("#intye").val(), {path: "/", expires: 30});
                   }              
           })

        })
</script>
</html>

 

jquery --cookie

原文:http://www.cnblogs.com/benpaodegegen/p/7590249.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!