Solved

Popup script when person leaves URL

Posted on 2002-05-13
6
163 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
6 Comments
 
LVL 5

Expert Comment

by:amandeep
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 9

Author Comment

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

Rowby
0
 
LVL 18

Expert Comment

by:bruno
Comment Utility
all set on this one Rowby?
0
 
LVL 9

Author Comment

by:Rowby Goren
Comment Utility
Thanks!

Rowby
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now