Solved

ColdFusion Open Popup Window On Exit

Posted on 2006-07-03
9
165 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
Turn your laptop into a mobile console!

The CV211 Laptop USB Console Adapter provides a direct Laptop-to-Computer connection for fast and easy remote desktop access with no software to install.

 
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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
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 integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

689 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