aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/window/length/index.html
blob: b5e37e034a8dfb17f82abfd3528a68aa7a8655c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
---
title: window.length
slug: Web/API/Window/length
translation_of: Web/API/Window/length
---
<div>
 {{ApiRef}}</div>
<h2 id="Summary" name="Summary">概述</h2>
<p>返回当前窗口中包含的框架数量(框架包括<code>frame</code><code>iframe</code>两种元素).</p>
<h2 id="Syntax" name="Syntax">语法</h2>
<pre class="syntaxbox"><i>framesCount</i> = window.length;
</pre>
<ul>
 <li><code>framesCount</code>就是该窗口中框架的数量.</li>
</ul>
<h2 id="Example" name="Example">示例</h2>
<pre class="brush:js">if (window.length) {
  // 该窗口包含至少一个子框架
}</pre>
<h2 id="Specification" name="Specification">规范</h2>
<p>{{DOM0}}</p>