Solved

ColdFusion Open Popup Window On Exit

Posted on 2006-07-03
9
146 Views
Last Modified: 2013-12-24
I want to open a popup window with a survey for visitors to my site BUT I only want the window to open when the visitors exits the site i.e. close the browser or go to a new URL.  Additionally, I only want to put the code on specific pages.

I have looked around quite a bit and can't even find a place to start.
0
Comment
Question by:dndco
  • 3
  • 2
9 Comments
 
LVL 13

Expert Comment

by:usachrisk1983
ID: 17037971
This cannot be done with ColdFusion, but can be with Javascript:

http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20924470.html

Instead of doing an alert on close, you can instead create your popup window.  There is a code generator here:

http://javascript.internet.com/generators/popup-window.html

Good Luck!
0
 

Author Comment

by:dndco
ID: 17039846
I know how to create a pop up window.  What I need is to control when it opens via a modified onunload.

If you say it can't be done with CF then I am going close this question here and open a new one in JavaScript.
0
 
LVL 13

Expert Comment

by:usachrisk1983
ID: 17039865
Dndco, the solution provided is the JS method to this.  The first link provides an EE solution to your problem.  I have pasted the accepted solution below, but there were a few recommendations on the page (CREDIT TO XP_COMMANDER)::

<html>
<head>
<Script>
function onClose(){

if(window.screenTop>10000){
alert("Good Bye , visit us soon !")
}
}
window.onunload=onClose

</Script>
</head>

<body>    
Try to close the window and see the alert msg
</body>
</html>
0
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
LVL 13

Expert Comment

by:usachrisk1983
ID: 17255855
Not sure if the original poster wound up going to JS for their popup, but I'm pretty sure mine was what he'd be looking for.
0
 

Author Comment

by:dndco
ID: 17257563
I solved this myself.  I found a site that did exactly what I was looking for.  It was done with AJAX.  Please close this question.  I apologize for being non-responsive.
0
 

Accepted Solution

by:
CetusMOD earned 0 total points
ID: 17698189
PAQed with no points refunded (of 125)

CetusMOD
Community Support Moderator
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ColdFusion Rereplace 3 62
htaccess restrict subdomain 4 70
JVM encoding. How to change encoding. 27 62
Problem to go to Web page 2 52
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now