Window:top 属性
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
返回对窗口层次结构中最顶层窗口的引用。
值
对最顶层窗口的引用。
备注
window.parent
属性返回当前窗口的直接父窗口,而 window.top
返回窗口对象层次结构中的最顶层窗口。
此属性在处理位于父窗口或多个父窗口的子框架中的窗口时特别有用,可以用来获取顶级框架集。
规范
Specification |
---|
HTML # dom-top-dev |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
top |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.