HashChangeEvent.oldURL

oldURL 为 HashChangeEvent 接口的只读属性,其值为窗口导航改变前的 URL。

语法

let oldEventUrl = event.oldURL;

返回值

示例

window.addEventListener('hashchange', function(event) {
  console.log('Hash changed from ' + event.oldURL);
});

规范

Specification
HTML Standard
# dom-hashchangeevent-oldurl-dev