Javascript examples for DOM:Event
Prevent event binded to object from being overridden
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w w w . j ava2s . com*/ window.addEventListener('beforeunload', function (e) { e.stopImmediatePropagation(); console.log('A') }); window.addEventListener('beforeunload', function (e) { e.stopImmediatePropagation(); console.log('B') }); } </script> </head> <body> </body> </html>