Javascript - detect the closing event

[Javascript] detect the closing event


How I can run a script before closing the window: after clicking on the X-USER closure. Thank you in advance


<script type="text/javascript"> 
function foo () 
alert ('foo'); 
window.onbeforeunload = function () {foo ()}; 
</ Script>


Solved by foxmaster
Published by aakai1056. Latest update on December 25, 2010 at 04:40 AM by aakai1056.
This document, titled "Javascript - detect the closing event ," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (
How To Disable JavaScript on Google Chrome
SRWare Iron - Disable Javascript