此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

NavigationCurrentEntryChangeEvent:from 属性

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

实验性: 这是一项实验性技术
在将其用于生产之前,请仔细检查浏览器兼容性表格

NavigationCurrentEntryChangeEvent 接口的 from 只读属性返回导航来源的 NavigationHistoryEntry

NavigationHistoryEntry 对象。

示例

js
navigation.addEventListener("currententrychange", (event) => {
  console.log(event.from);
});

规范

Specification
HTML
# dom-navigationcurrententrychangeevent-from-dev

浏览器兼容性

参见