Solved

Popup script when person leaves URL

Posted on 2002-05-13
6
191 Views
Last Modified: 2010-03-05
I want a script to pop UP a window when someone leaves a web page.

For example if someone is at www.rowby.com/index.html and goes to ANY other URL then the popup window appears.

I guess this has to be javascript, but perhaps there is a more stable non javascript based perl solution -- in case someone has javascript turned of.  HOWEVER if it needs to be javascript, then that's okay.

I guess this is a simple question. If not, let me know and I'll increase the points.

Thanks

Rowby
0
Comment
Question by:Rowby Goren
[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
6 Comments
 
LVL 5

Expert Comment

by:amandeep
ID: 7007165
rowby,

This is certainly a javascript solution. What u can do is, modify the html page and put the onUnLoad event to the BODY tag.

<body onUnLoad="popupFunction()">

The popupFunction() can be defined as

<SCRIPT language='javascript'>
function popupFunction() {
   alert("Thank You for visiting My WebSite!");
}
</SCRIPT>

Instead of the 'alert' above, you can place ur own code.

Aman.
0
 
LVL 1

Accepted Solution

by:
GorGor1 earned 100 total points
ID: 7008646
you can also include a noscript tag in your main window that alerts the user that the page will not function properly if he has javascript turned off.

<noscript>
Please enable javascript!<br>
</noscript>

It works with most new browsers
0
 
LVL 9

Author Comment

by:Rowby Goren
ID: 7008800
Thanks for the solution(s).  I'll keep this question live or a day or so in case there are other comments -- and then award the points.

ROwby
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Author Comment

by:Rowby Goren
ID: 7050000
Sorry it took so long to award the points!  I forgot about this one!

Rowby
0
 
LVL 18

Expert Comment

by:bruno
ID: 7186438
all set on this one Rowby?
0
 
LVL 9

Author Comment

by:Rowby Goren
ID: 7186464
Thanks!

Rowby
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

729 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