GHCCash Home


| HOME > FAQ > How To: Popups

Frequently Asked Questions
How to Make Exit PopUps

[ ABOUT GHC | CONTENT | BANNERS | FAQ | | SIGN UP | CHECK STATS ]


Exit Popups can be made in 2 ways: as popups or as pop-unders.
For both you'll need to install some code for the exit popup as detailed below:


METHOD #1) "blur" popup or "pop-under" loads the popup behind the
current window. To do this, between the <head> tags of your document
place this code:

<SCRIPT language="JavaScript">
<!-- window.open('http://www.fullpath.tofile/popup.htm','_blur',
'width=640,height=480, resizable=no, scrollbars=yes, top=120,left=190');
if (window.focus) {
window.focus(); }
// -->
</SCRIPT>

Set the width, height, top and left tags to fit and place the page best.

This method will result in the po-punder ALWAYS loading.. and may piss
off your customers. It's probably best used on the very last page a user
may visit, for instance as part of your final popup to load one last page for
the visitor before they leave.

--------

METHOD #2) a normal popup - loads on top of the page when the user exits.


This type of popup will always load when the user exits the page unless
you add some extra code in your html links where you DON'T wan't it to
occur. I'll show you how to do all of this below:

To start off, between the <head> tags of your document, place this code:

<SCRIPT language="JavaScript">
<!--
var goback=true;
function exit()
{
if (goback) open('http://www.fullpath.tofile/popup.htm','Exit','resizable=no,
scrollbars=no,toolbar=no,location=no,directories=no,status=no,
menubar=no,width=640,height=480);
}
// -->
</SCRIPT>

Again, set the width and height tags to fit the page best.


For example the top of your web page may look like the following:

<html>
<head>
<title>Your web page title</title>
[copy and paste the code here]
</head>
<body…

Also, in your body tag you need to add this code:

onUnload="popup('http://www.fullpath.tofile/popup.htm')"

For example, your body tag may look like the following:

<body onUnload="popup('http://www.fullpath.tofile/popup.htm')"
link="#FF9999" background="bg2.gif">

This code makes the popup appear when the browser window is closed.

Now, for links on the same page where you don’t want the popup to occur
when clicked (eg. to purchase your product, or go deeper in the site), for
every link and button where you want to stop the popup appearing if the
user clicks it, just add the following code:

onclick=’exit=false;’

Here’s an example of a link that contains this:

<a href="ccbill/join.htm" onClick="exit=false">JOIN NOW</a>

For all other links and buttons, just leave alone and the popup will appear
when they leave the page.

Hope this helps!

One thing... Be careful with use of popups as they may annoy surfers if
used too much and can sometimes do more harm than good. But, when used in moderation they can be a very useful tool. Good luck!


^ TOP ^


[ ABOUT GHC | CONTENT | BANNERS | FAQ | | SIGN UP | CHECK STATS ]