From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/window/self/index.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 files/zh-cn/web/api/window/self/index.html (limited to 'files/zh-cn/web/api/window/self') diff --git a/files/zh-cn/web/api/window/self/index.html b/files/zh-cn/web/api/window/self/index.html new file mode 100644 index 0000000000..2d0504ef26 --- /dev/null +++ b/files/zh-cn/web/api/window/self/index.html @@ -0,0 +1,22 @@ +--- +title: Window.self +slug: Web/API/Window/self +translation_of: Web/API/Window/self +--- +

{{ APIRef() }}

+

概述

+

返回一个指向当前 window 对象的引用。

+

语法

+
objRef = window.self
+
+

示例

+
 if (window.parent.frames[0] != window.self) {
+    // 当前对象不是frames列表中的第一个时
+ }
+
+

备注

+

window.self 几乎总是用于上面示例那样的比较,用来判断当前 window 是不是父 frameset 中的第一个 frame。

+

规范

+

HTML5

+
+  
-- cgit v1.2.3-54-g00ecf