GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Javascript Exit Popup Code: Please (https://gfy.com/showthread.php?t=527673)

BigRod 10-13-2005 11:42 AM

Javascript Exit Popup Code: Please
 
Hello GFY I am looking for a exit popup script that works. If it works in both IE and Firefox thats a plus.

Your help is greatly appreciated!

Thanks ahead of time :thumbsup

BigRod 10-13-2005 12:19 PM

Bump....

fetishblog 10-13-2005 12:36 PM

Code:

<SCRIPT LANGUAGE="JavaScript">
<!--begin

function popup(filename){
window.open(filename, "","height=300,width=300,top=0,left=0,location=no,menubar=no,
resizable=yes,scrollbars=no,status=no,titlebar=no,toolbar=no,directories=no");
}
// end -->
</SCRIPT>

To make the new window pop up on exit using the example code above, you simply add the following code to your body tag:

Code:

onUnload="popup('popup.html')"
Your body tag may therefore look like the following:

Code:

<body bgcolor="white" onUnload="popup('popup.html')">
As you can see by this code, we have set a variable to true, and then test that this variable is still true before the new window is displayed. If the variable is not true, the popup will simply not appear.

To enable this, we need to then add code to all the links and buttons, where if the user clicks them we do *not* want the popup to appear. Other links and buttons we just leave well alone.

This is the code we need:

Code:

onclick="exit=false;"
This sets the value of the exit variable to false, so that when the test on the variable runs, it will fail and the new window will not appear.

We add this code to the relevant tags for buttons and links as follows. Here's an example for a standard link:

Code:

<a href="purchase.html" onclick="exit=false;">Buy now!</a>
If you want to add the code to a button rather than a link, here's an example of how you should install the code:

Code:

<input type="button" value="Buy now!" onclick="exit=false;">
That's all there is to it. As always, make sure you test your web page before you upload it to your web site to make sure it works to your satisfaction.

romeoboi 10-13-2005 12:40 PM

Ive seen a few sites use a 1x1 pixel size flash .swf file that is able to popup a window without getting blocked by the popup blockers which work on javascript - anyone know where there is more info on something like that?

Argoz 10-13-2005 12:54 PM

Quote:

Originally Posted by romeoboi
Ive seen a few sites use a 1x1 pixel size flash .swf file that is able to popup a window without getting blocked by the popup blockers which work on javascript - anyone know where there is more info on something like that?

Good question.

BoNgHiTtA 10-13-2005 12:56 PM

Cant do exit pops in firefox from what I understand. Smokey has some good stuff for doing it in IE though. Search by his name

woj 10-13-2005 02:13 PM

Quote:

Originally Posted by fetishblog
...

good info, but too bad that hasn't worked for 2+ years...

BigRod 10-13-2005 03:08 PM

Thanks for the info people very much appreciated....


All times are GMT -7. The time now is 01:12 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123