Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 为lightbox表单设置cookie_Jquery_Html_Cookies_Set - Fatal编程技术网

Jquery 为lightbox表单设置cookie

Jquery 为lightbox表单设置cookie,jquery,html,cookies,set,Jquery,Html,Cookies,Set,我有一个html和jquery格式的表单,我想设置cookie,我该怎么做 { <script> $(document).ready(function() { $('#back').fadeIn(1000); }); $(document).ready(function() { $('#close-btn').click(function(){ $('#popup').fadeOut

我有一个html和jquery格式的表单,我想设置cookie,我该怎么做

 {
 <script>
     $(document).ready(function() {   
         $('#back').fadeIn(1000);
     });
     $(document).ready(function() {
         $('#close-btn').click(function(){
             $('#popup').fadeOut("fast");
         });
     });    
 </script>

 <html>
     <body>
         <div id="popup">
             <div id="back">
                 <div id="right">
                     <div style="width:18px; height:19px;">
                         <img src="img/Close.png" width="18"  style="cursor:pointer;display:block; margin-  left:350px;margin-top:-2px;" onclick="document.getElementById('back').style.display='none';"/>
                     </div>   
                     <div id="login-box">
                         <form id="login" name="welcome" action="#" method="post">
                         <div id="c" >
                             <span style="font:B Mitra; font-size:24px; font-weight:bold; color:#000;padding- left:270px;position:relative;top:-40px;"> ایمیل</spam>      
                             <input name="username"  onfocus="if (this.value = 'آدرس ایمیل') { this.value=''; }"   onblur="if      (this.value == '') { this.value='آدرس ایمیل'; }" style="position:absolute; margin:-30px 0 0 60px; width:215px; height:25px; text-align:right; background:#ffffff; border:2px solid #0CF;border-radius:10px; color:#000; font:11px tahoma; left: -15px; top: 29px; border-radius:5px;" type="text"       value="آدرس ایمیل  "></div>                            
                         <div style="margin-top:35px;margin-left:120px;">
                             <input value="ارسال" name="submit" type="submit" style="background-color:#fcaf17;border-radius:5    px;   border:none; width:109px;height:35px;  font-family:tahoma; color:#FFF; font-size:18px;
font-weight:bold; ">
                         </div>
                         </form>
                  </div>
             </div>
         </div>
     </body>
 </html>
}
{
$(文档).ready(函数(){
$('背').fadeIn(1000);
});
$(文档).ready(函数(){
$(“#关闭btn”)。单击(函数(){
$('popup')。淡出(“快速”);
});
});    
ایمیل      
}
您可以使用非常轻松地设置、读取和删除cookie

// Set a cookie
$.cookie('foo', 'bar');

// Read a cookie
$.cookie('foo'); // returns bar

// Delete a cookie
$.removeCookie('foo');

你想什么时候设置cookie?谢谢,但我不知道如何使用插件,我写你写的代码就够了吗?我想每天为每个用户显示一次我的表单