views:

69

answers:

2

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
is this syntax on how to check if a cookie is set? http://pastebin.com/m6210e1bf
adred
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