Problem with onClose event

Hellow :slight_smile:



I would like to run a javascript code just before the user close a window.



The event is correctly catched but the window is not closed after the js code. Can you tell me please what is the problem with this minimal sample :





    

    

    

    









How can I close the the window after the alert message ?



Thanks for your answer :slight_smile:

You need to have

w1.attachEvent(‘onClose’,function(w1){alert(‘This window will be closed’); return true; });

Returning false or equal value ( returning nothing ) from event handler block operation.

It works, thanks a lot :slight_smile: