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
https://forums.phpfreaks.com/topic/75966-solved-onunload/#findComment-384903
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
https://forums.phpfreaks.com/topic/75966-solved-onunload/#findComment-384910
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
https://forums.phpfreaks.com/topic/75966-solved-onunload/#findComment-384931
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.