Click to See Complete Forum and Search --> : Javascript - Close Window


Squid
January 11th, 2005, 09:53 PM
I need some aids here. When user click on the close window, I want a pop up button asking user if he wishes to logout. How can I do that? Can someone point me where to go from here?

HanneSThEGreaT
January 12th, 2005, 10:26 AM
Have a look here:
http://www.codingforums.com/showthread.php?t=10538&highlight=close+window

That's the best I can do :D

Squid
January 12th, 2005, 09:15 PM
I think I get the answer now. Still, I am having some problems. My codes are:

<HTML>
<HEAD>
<SCRIPT>
function closeIt()
{
event.returnValue = "Testing";
}
</SCRIPT>

<FRAMESET ROWS="50%,50%">
<FRAME NAME="One" SRC="one.php">
<FRAME NAME="Two" SRC="two.php">
</FRAMESET>
</HEAD>

<BODY onbeforeunload="closeIt()">
</BODY>
</HTML>

If I put the codes as above, the function onbeforeunload="closeIt()" does not work at all but I can managed to see the frames. If I put the function onbeforeunload="closeIt()" before the frameset, I cannot view the frames at all and javascript function is working. How can I solve this so that I can view the frames and want the javascript function to work as well?