Jump to content

[SOLVED] OnUnload


jaymc

Recommended Posts

That isnt working unless I have mistaken

 

Here is test code

 

<html>

<head>

 

 

<SCRIPT LANGUAGE="JavaScript">
window.onclose = alert('Closing')
</script>

</head>
<body>

adad

</body>
</html>

 

When I refresh it gives the alert, when I close it doesnt

 

Any ideas?

Link to comment
Share on other sites

well got this code which works in IE

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>

<BODY onunload="logoutto()">
<script>
function logoutto()
{

if ((window.event.clientY < -3000) && (window.event.clientX < -3000)) 
{

	 	//
	alert('Window closed');


} 


}
</script>
</BODY>
</HTML>

Link to comment
Share on other sites

maybe u can add some alert statements and tell me if you get any alerts I do not have IE7 otherwise would of tested it

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>

<BODY onunload="logoutto()">
<script>
function logoutto()
{
alert(window.event.clientY);
alert(window.event.clientX);
if ((window.event.clientY < -3000) && (window.event.clientX < -3000)) 
{

	 	//
	alert('Window closed');


} 


}
</script>
</BODY>
</HTML>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.