can anyone please tell me what is the error on this code? I am trying to set a cookie for the fancybox popup but it is showing on every refresh. All .js are 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 the code block to the following and it’s functioning as expected both in Chrome 13 and FF5.
FireFox 5

Chrome 13

First run, I receive the box and the cookie is set. Thereafter, no box.
I did notice some strangeness with Chrome where the cookie would not appear in the console occasionally but debugging the script in fact revealed the cookie was set and functioning.