Popup Ad Cookies

Thursday October 18, 2007

By request, here's some instructions for adding cookies to the popup ads to prevent the ads from popping up more than one time per browser session.

The function that starts the popup needs to check to see if a cookie exists and act accordingly. For the fly-in layer ad, the function startAp() is where we will be working, and for the fade-in layer ad, it will be the function startAf(). We need to wrap an if statement around the two lines within the function so the function only starts the popup if the condition is true.

So here's the code we need to insert as a replacement for the two lines originally in the function...

if(document.cookie.indexOf('popup') < 0) {
	document.cookie = 'popup=yes; path=/;';
	setLeft();
	showAp();
}

Ok, so first we wrap an if statement around the two lines within the function that checks to see if a cookie named "popup" has been set. If the cookie has been set, the statement will prevent the popup from continuing. If the cookie has not been set, the statement will proceed with the popup process by setting a cookie and continuing on. The cookie that is set will prevent the popup from appearing any more during the current browser session.

NOTE: The example above is for the fly-in layer ad, make sure you change the showAp(); line to showAf(); if you are using the fade-in popup. Also, this cookie does not have an expiration date set, so it will be removed by default when the browser is closed. If you want the cookie to exist until a specified time, you need to set the expiration date.

Please refer to this site for more on cookies.. http://www.quirksmode.org/js/cookies.html

All in a Name

Tuesday October 16, 2007

I see so many different names and terminologies used around the web for what I call an unblockable popup. I've seen hover ad, pop in, pop-in, dhtml popup, CSS popup, div popup, layer ad, and others. So what's the general consensus on what to call these things that I call unblockable popups?

These advertising mechanisms are just a combination of CSS and javascript that shows and hides a div element in a standard xhtml document therefore circumventing modern day popup blocking applications.

So I guess any combination of those terminologies is acceptable, but I think I'll stick with unblockable popup ad. What do you think?

By request... New Fade Ad Popup Window

Monday October 15, 2007

The latest in the unblockable popup series is by request. It's a hover ad with the look and feel of a real window. It's "The Rich Geek" popup that you may have already seen on my site.

I put this zip file together pretty quickly, so please let me know if you find any mistakes.

It's basically the same as the original fade ad with the contents of the window spiced up with some nice looking window graphics.

Hope you enjoy and keep your comment/suggestions coming!! My current project is a super version of the AJAX Calendar with lots of added features, so check back in the next week or so for that one!


Archives