10

有什么方法可以在window.popstate触发时获取新页面的 url?

window.onpopstate(function (){
    newPageUrl = //get the new page's URL
})
4

1 回答 1

18

用这个

window.onpopstate(function (){
    newPageUrl = location.href;
})
于 2016-09-15T05:22:10.613 回答