Javascript examples for DOM:Event
Check if the user changes domain vis window onhashchange event
<html> <head> <script> window.start = function(){/*from w w w . ja va2s . c o m*/ var url = "http://www.yoursite.com"; if ("onhashchange" in window) { console.log("The browser supports the hashchange event!"); } function locationHashChanged() { if (location.hash != url) { console.log('change url'); } } window.onhashchange = locationHashChanged; } </script> </head> <body onload="window.start();"> </body> </html>