Solved

Popup script when person leaves URL

Posted on 2002-05-13
6
175 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Perl Script - Remove row of data based on column value 3 75
Perl 101 11 76
Perl Script - Remove column of data based on column value 2 51
perl to convert excel to csv 3 208
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
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…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

785 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