?
Solved

Popup script when person leaves URL

Posted on 2002-05-13
6
Medium Priority
?
197 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 400 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
Industry Leaders: 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

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!

Question has a verified solution.

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

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
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

764 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