Returns the element (such as
Note that despite its name, the property also works for documents inside
Summary
<iframe>
or
<object>
) in which the window is embedded, or
null
if the window is top-level.
Syntax
var frameEl
= window.frameElement;
frameEl
is the element which the window is embedded into, or
null
if the window is top-level.Example
var frameEl = window.frameElement;
// if we are inside a frame, then change it's URL to 'http://mozilla.org/'
if (frameEl)
frameEl.src = 'http://mozilla.org/';
Notes
<object>
and other embedding points.
window.frameElement
最新推荐文章于 2023-08-04 08:31:02 发布