event on url change javascrip code example Example: javascript on url anchor change event window.addEventListener('hashchange', function() { ... })