I have created a jQuery a pop up form which I intend to load each time a user visits to my site. And then prevent it from loading if he hasn't left my site yet. How can I tell jQuery to do that?
A:
You probably need to set a cookie from the server. If the cookie isn't set, call a jquery method to display the form and set the cookie. if the cookie is set, don't tell jQuery to display the form.
PatrikAkerstrand
2010-01-28 11:42:41
is this syntax on how to check if a cookie is set? http://pastebin.com/m6210e1bf
adred
2010-01-28 14:03:29
A:
most stimple version: check if document.referrer.indexOf('yourdomain.tld') != -1
you could also use cookies - google will find you some jquery plugins for comfortable cookie handling ...
roman
2010-01-28 11:44:03