Window.frameElement
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.frameElement
속성은 <iframe>
이나 <object>
처럼 현재 창을 포함한 요소를 반환합니다. 창이 다른 문서에 포함된 것이 아니거나, 문서의 출처가 다른 경우, 즉 창과 해당 문서의 도메인이 서로 다른 경우 null
을 반환합니다.
예제
js
var frameEl = window.frameElement;
// If we're embedded, change the containing element's URL to 'http://mozilla.org/'
if (frameEl) {
frameEl.src = "http://mozilla.org/";
}
명세
Specification |
---|
HTML # dom-frameelement-dev |
브라우저 호환성
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
frameElement |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
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.
같이 보기
window.frames
는 현재 창의 모든 자식 프레임을 배열형 객체로 나열합니다.window.parent
는 부모 창, 즉frameElement
를 담고 있는 창을 반환합니다.