How can I make JavaScript (or jQuery) code only execute on the visitor’s first visit and never again until a cookie expires or is removed?
For example: $('#example').hide(); How can I prevent this code from executing for 7 days for this visitor?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
try this tut: http://www.electrictoolbox.com/jquery-cookies/
set a cookie on first visit, read it out on any subsequent visit and do something like: