View Full Version : on unload function

06-23-2002, 02:02 AM
I have a (quasi) legitimate reason to use the "on unload function," and now can't find where I was reading about it...

does anyone know where to locate script for it?

06-23-2002, 03:23 AM
Hi Judy, could give us an idea of what you want to happen with the onunload event handler. It makes a difference what script is used and could also need to include special syntax for cross browser compatibility.:)

Example: If you just want to use the built-in alert box function for Netscape and Explorer to say "Thank you for visiting Regardless Shorthairs" then this anywhere in the body will do it.
<BODY onUnload="alert('Thank you for visiting Regardless Shorthairs')">
Even this doesn't work for other browsers.

Edit: for sp.

06-23-2002, 03:40 AM
window.onunload = fuction() {

Quick example of how to use it.

06-23-2002, 04:50 AM
but I found a script:


that I think is really neat. When you click on a button, a page comes up that looks like what you see when you're downloading a program (sort of anyway). It says:

"Now downloading virus"

and looks as though something is actually downloading.

I'd like to use it, but I can picture people madly trying to close the window, and leaving my site.

So I want to use "on unload" to take them to a page explaining that it was a joke, with a history (-2) to take them back to the page they came from.

An "on unload" pop-up would be nice, but I don't think I've ever seen one...

Philip M
06-23-2002, 10:12 AM
Good heavens, no. Certainly not. Who could posibly have thought that?

06-23-2002, 12:29 PM

Fair well window launcher script
By JavaScript Kit (http://javascriptkit.com)
Over 200+ free scripts here!

function openpopup(){
//configure "seeyou.htm and the window dimensions as desired

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
return returnvalue;

function loadpopup(){
if (get_cookie('popped')==''){


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum