0

i have some code:

$(document).ready(function(){  
    setTimeout(function(){
tb_show('yeah', '#TB_inline?height=490&width=534&inlineId=compare', false);
    },13000);
});

what i want is when this script runs a cookie to be created and to expire in 4 days so that the script wont run unless the cookie has expired.

maybe use something like this:

$.cookie("compare", "hello", { expires: 7 });

any ideas?

thanks

gen_Eric
  • 214,658
  • 40
  • 293
  • 332
Patrioticcow
  • 25,174
  • 72
  • 208
  • 332

1 Answers1

1

There is a jQuery plugin that does exactly that:

https://github.com/carhartl/jquery-cookie

bgun
  • 99
  • 3