我的谷歌搜索没有找到任何结果。
当你这样做时:
var stateObj = { state: "some state" };
history.pushState(stateObj, "page 2", "other.htm");
有关联的窗口回调函数吗?
我知道有这个:
window.onpopstate = function() {
}
对于监听用户点击返回按钮的情况,它非常有效。但我想监听任何时候URL发生的变化,我不确定该怎么做。
是否有一个全局回调函数来监听任何时候URL发生的变化?