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
  • 223,194
  • 41
  • 299
  • 337
Patrioticcow
  • 26,422
  • 75
  • 217
  • 337

1 Answers1

1

There is a jQuery plugin that does exactly that:

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

bgun
  • 99
  • 3