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.
Editor; FrontPage 2002 (included in Office XP). Personal Operating System; Windows XP and ME. Browsers; Latest versions, NN, IE and Opera. Server running; RedHat Linux 7.2
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...
/*
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
window.open("seeyou.htm","","width=300,height=338")
}
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')==''){
openpopup()
document.cookie="popped=yes"
}
}
Comment