Solved

ColdFusion Open Popup Window On Exit

Posted on 2006-07-03
9
161 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
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
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

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Annoying "thing" blocks my view 4 143
spamming  on Hosted svrs? 6 109
cookies analysis tools 2 110
Public IP Address Amazon Servers 2 68
Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
What You Need to Know when Searching for a Webhost Provider
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…
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…

737 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