Solved

ColdFusion Open Popup Window On Exit

Posted on 2006-07-03
9
158 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
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
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 manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

820 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