Problemm is: I have form that has changed data in it and on onbeforeunload event i bind form validation and warning message about unsaved data. Erlier i've used return/confirm function, so user has seen browser modal window with two buttons Ok and Cancel. As this case difficult to test I decided to开发者_StackOverflow do over confirm process whithout using those two functions.
How can I interrupt page unload inside onbeforeunload event without using confirm/return functions.
There is no other way to prevent page unload other then using onbeforeunload
event - if there was google would probably have used it in gmail - but they didn't.
If you'd try to do it with unload
event you can at best force the user to stay on the same page - page will reload though and most likely you'll loose all your data.
精彩评论