please help with this script ?

M

Mel

i have the following script that works:

window.onbeforeunload = confirmExit;

function confirmExit()
{
return "YOU ARE LEAGING THE CHAT"
}


however, i would like to navigate to a URL when the user answers Yes or OK

please help
 
M

McKirahan

Mel said:
i have the following script that works:

window.onbeforeunload = confirmExit;

function confirmExit()
{
return "YOU ARE LEAGING THE CHAT"
}


however, i would like to navigate to a URL when the user answers Yes or OK

please help


The IE onBeforeUnload Event Handler
http://www.webreference.com/dhtml/diner/beforeunload/

The IE onBeforeUnload Event Handler
http://www.siteexperts.com/paradise/getResource.asp?r_id=1035

Not what you want but ...

<html>
<head>
<title>leaving.htm</title>
</head>
<script type="text/javascript">
window.onbeforeunload = confirmExit;
function confirmExit() {
confirmGoTo();
return "YOU ARE LEAGING THE CHAT";
}
function confirmGoTo() {
var url = "http://www.google.com/";
if (confirm("Google?")) location.href = url;
}
</script>
<body>
</body>
 
R

Richard

i have the following script that works:

And extremely annoying.
Yes I know I am leaVing the chat.
Why do you insist on telling me this?
"We're sorry, but you can't leave."
Bye bye.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top