Get the new URL in window.popstate

Is there a way to get the new page url at startup window.popstate?

window.onpopstate(function (){
    newPageUrl = //get the new page URL
})
+4
source share
1 answer

Use this

window.onpopstate(function (){
    newPageUrl = location.href;
})
+3
source

Source: https://habr.com/ru/post/1654651/


All Articles