Monday, 15 June 2015

javascript - How to create an if statement with jquery.cookie -


So I have this code below and now I want to apply this code only once a month to set a fire How can I complete this?

  $ (function () {follow $ var = $ ("follow-1"); if (! $ Follow.hasClass ("active")) {$ Follow.click ( );}});  

You can mean something like this:

  $ (Function () {var cook = $ .cookie ("seen"); // if (cookie!) Get the cookie (// if a cookie show follows $ var = $ ("follow- 1 "); if ($ $ Follow.hasClass (" active ")) {$ follow.click ();} $ .cookie (" seen "," yes ", {" expired ": 30}); // set cookie expires in 30 days}});  

No comments:

Post a Comment