<script> window.addEventListener("popstate", function(e) { alert([ e.state, e.URL, e.title, e.type ].join('\n')); }); history.replaceState({page: 3}, "title 3", "?page=3"); </script>