check url change javascript code example
Example: how to detect a url change
window.addEventListener('popstate', function (event) {
// The URL changed...
});
window.addEventListener('popstate', function (event) {
// The URL changed...
});