J
Jiong Feng
Hi, (I only consider IE6)
I am writing a page which redirect user to another page during onunloadevent
(I will use window.confirm to ask user's agreement).
But when user do a refresh, the window.confirm shows up but if user select
ok, the redirect fails.
How to make it work? (either not show window.confirm on refresh window, or
make the redirect work on refresh)
Thanks
Jiong
Sample code is here:
////////////////////////////////////////////////////////////////////////////
///////////////////////////
<html>
<script language="Javascript">
function onUnLoadHandler() {
if(window.confirm("agree to redirect?"))
window.location.href="/redirect.htm"; // this does not work
when refresh window, why?
}
</script>
<body OnUnload="onUnLoadHandler()" >
something
</body>
</html>
////////////////////////////////////////////////////////////////////////////
//////////////////////////
I am writing a page which redirect user to another page during onunloadevent
(I will use window.confirm to ask user's agreement).
But when user do a refresh, the window.confirm shows up but if user select
ok, the redirect fails.
How to make it work? (either not show window.confirm on refresh window, or
make the redirect work on refresh)
Thanks
Jiong
Sample code is here:
////////////////////////////////////////////////////////////////////////////
///////////////////////////
<html>
<script language="Javascript">
function onUnLoadHandler() {
if(window.confirm("agree to redirect?"))
window.location.href="/redirect.htm"; // this does not work
when refresh window, why?
}
</script>
<body OnUnload="onUnLoadHandler()" >
something
</body>
</html>
////////////////////////////////////////////////////////////////////////////
//////////////////////////