Javascript examples for jQuery Method and Property:on
Listening for HTML navigation events
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-compat-git.js"></script> <script type="text/javascript"> $(window).on('load', function() { $(window).on("beforeunload", function() { return "This is a jQuery version"; });/*from www . j av a 2s.co m*/ }); </script> </head> <body> <!-- try navigating away from this page --> </body> </html>