Want to call a functionality on window.onbeforeunload
I am doing an application which is using Flex UI and java . I calling the swf as an object embeded in jsp. I want to do a functionality call will I do a browser close.
This call to flex functon is working fine for me...
The issue is due to the return statment I am getting an confirm alert asking are you sure to navigate away from thiis page..... The functionality I am doing is cancel transaction function . If the user click OK then every thing is fine. But if he clicks cancel the browser will not get closed but and transaction will also get cancelled which is wrong.
If i remove the return then functionality will not get called as the browser is getting closed before it calls the function.
I tried setimeout also ..but it is not possible to call setTimeout in onbeforeunload