brandon1974
06-21-2004, 10:29 PM
Hello,
I'm having some difficulty accomplishing what I want. I want to redirect a user if they choose to close their browser window or keep them on the same page if they do not. The page in question is a frameset.
Here is the script I have so far, which is not workinng. The window will simply close.
<script>
window.onBeforeUnload = DoLogout
function DoLogout(){
if(confirm("Are you sure you want to leave?")) {
window.navigate("default.asp?logout=yes")
}
else {
window.open("admin_home.asp")
}
}
</script>
Can someone please point me in the right direction? I'd really appreciate some help!
TIA,
Brandon
I'm having some difficulty accomplishing what I want. I want to redirect a user if they choose to close their browser window or keep them on the same page if they do not. The page in question is a frameset.
Here is the script I have so far, which is not workinng. The window will simply close.
<script>
window.onBeforeUnload = DoLogout
function DoLogout(){
if(confirm("Are you sure you want to leave?")) {
window.navigate("default.asp?logout=yes")
}
else {
window.open("admin_home.asp")
}
}
</script>
Can someone please point me in the right direction? I'd really appreciate some help!
TIA,
Brandon