Let me ask my question as an example:
I have a site named mysite.com
I give you a code to place on your site and when a visitor sees your site, a pop up appears (which is a page defined in mysite.com/popup.php)
your code is : <script language=JavaScript src=http://www.mysite.com/popup.php?id=x></script>
and for each unique visitos you get 1 point by me.
The problem is this: when someone that has popup blocker visits your site he doesnt see the popup but you get 1 point.
How can i prevent this? and how can i define whether popup executed or not?
Pop up blocked or not?
Moderator: General Moderators
Re: Pop up blocked or not?
You can add a small 1x1px image somewhere in the pop up content and this image will be with source fx. award_points.php?id=xx , however this is easy for abuse and you should think of some security if you are afraid from people opening award_points.php?id=xx for getting points. Such protection could be done with cookies, etc.
Re: Pop up blocked or not?
unfortunately popup pages are not in my control and are other people page.
so i haven't any access to them.
The only file I have access is mysite.com/popup.php which do all the popup work and also adds point - even when they are blocked
so i haven't any access to them.
The only file I have access is mysite.com/popup.php which do all the popup work and also adds point - even when they are blocked
Re: Pop up blocked or not?
You can handle this in two ways: use a redirect header with a small delay (say 100ms) to the actual add, so if the window was closed before that it won't reach the add (and add to the count). Alternatively you can implement the same idea using a javascript timeout (setTimeout())