The Wayback Machine - https://web.archive.org/web/20080909092615/http://developer.mozilla.org:80/en/DOM/window.frameElement

Mozilla.com

  1. MDC
  2. Main Page
  3. DOM
  4. window.frameElement

Some features of this site require JavaScript.

window.frameElement

« Gecko DOM Reference

Summary

Returns the element (such as <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

Note that despite its name, the property also works for documents inside <object> and other embedding points.

See also

  • window.frames returns an array-like object, listing the direct sub-frames of the current window.
  • window.parent returns the parent window, which is the window containing the frameElement of the child window.

Specification

DOM Level 0. Not part of any standard.


Languages

Page last modified 14:12, 27 Jan 2008 by Potappo

Files (0)

 
 
 
Morty Proxy This is a proxified and sanitized view of the page, visit original site.