?
Solved

ColdFusion Open Popup Window On Exit

Posted on 2006-07-03
9
Medium Priority
?
172 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

 
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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
Suggested Courses

777 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