aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/window/defaultstatus/index.html
blob: 97e48af30e034f066ab0b7e5ccb6e74fad0e0c81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
title: Window.defaultStatus
slug: Web/API/Window/defaultStatus
tags:
  - HTML DOM对象
  - 接口
translation_of: Web/API/Window/defaultStatus
---
<p>{{ obsolete_header(23) }}</p>

<p>{{ APIRef() }}</p>

<h2 id="Summary" name="Summary">Summary</h2>

<p>获取或设置给定窗口的状态栏文本。</p>

<h2 id="Syntax" name="Syntax">Syntax</h2>

<pre class="eval"><em>var sMsg</em> = window.defaultStatus;
window.defaultStatus = <em>sMsg;</em>
</pre>

<h3 id="Parameters" name="Parameters">Parameters</h3>

<ul>
 <li><code>sMsg</code>   是一个保存了状态栏默认显示文本的字符串.</li>
</ul>

<h2 id="Example" name="Example">Example</h2>

<pre>&lt;html&gt;
 &lt;body onload="window.defaultStatus='hello!';"/&gt;
  &lt;button onclick="window.confirm('你确定要退出?');"&gt;confirm&lt;/button&gt;
 &lt;/body&gt;
&lt;/html&gt;
</pre>

<h2 id="Notes" name="Notes">Notes</h2>

<p>页面HTML加载完成后要设置状态栏内容可以使用  <a href="/en/Gecko_DOM_Reference/window/status" title="en/Gecko_DOM_Reference/window/status">window.status</a>.</p>

<h2 id="Specification" name="Specification">Specification</h2>

<p>HTML5</p>