当 window.popstate
被触发时,有没有办法获取新页面的 URL?
window.onpopstate(function (){
newPageUrl = //get the new page's URL
})
当 window.popstate
被触发时,有没有办法获取新页面的 URL?
window.onpopstate(function (){
newPageUrl = //get the new page's URL
})
window.onpopstate = function (){
newPageUrl = location.href;
}
location.href
不起作用吗? - Alexander O'Mara