Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有什么方法可以在window.popstate触发时获取新页面的 url?
window.popstate
window.onpopstate(function (){ newPageUrl = //get the new page's URL })
用这个
window.onpopstate(function (){ newPageUrl = location.href; })