Problem on setting a cookie on a jquery script -


can please tell me error on code? trying set cookie fancybox popup showing on every refresh. .js included.

<script>  $(document).ready(function(){  if(!$.cookie('the_cookie1')){     $.cookie('the_cookie1', 'true', { expires: 3});  $.fancybox(         '<h2>hi!</h2><p>lorem ipsum dolor</p>',         {                 'autodimensions'    : false,             'width'             : 350,             'height'            : 'auto',             'transitionin'      : 'none',             'transitionout'     : 'none'         }            ); }  });  </script> 

i modified code block following , it's functioning expected both in chrome 13 , ff5.

<script>      $(document).ready(function () {         var cookiename = 'the_cookie1';          var cookie = $.cookie(cookiename);         if(cookie === null) {              var cookieoptions = { expires: 3, path: '/' /*domain:, secure: false */ };              $.cookie(cookiename, 'true', cookieoptions);              $.fancybox(                 '<h2>hi!</h2><p>lorem ipsum dolor</p>',                 {                     'autodimensions': false,                     'width': 350,                     'height': 'auto',                     'transitionin': 'none',                     'transitionout': 'none'                 }             );         }      });  </script> 

firefox 5 enter image description here

chrome 13 enter image description here

first run, receive box , cookie set. thereafter, no box.

i did notice strangeness chrome cookie not appear in console debugging script in fact revealed cookie set , functioning.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -