HashChangeEvent.newURL

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

语法

let newEventUrl = event.newURL;

返回值

DOMString.

示例

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

规范

规范 状态 注释
HTML Living Standard
HashChangeEvent: newURL
Living Standard