Solved

Popup script when person leaves URL

Posted on 2002-05-13
6
171 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
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
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 is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

919 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

12 Experts available now in Live!

Get 1:1 Help Now