blob: 88128c0d94755f1dc77a9d0f7363ccb184f06da9 (
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
|
---
title: console.dir
slug: Web/API/Console/dir
translation_of: Web/API/Console/dir
---
<div>{{APIRef("Console API")}}{{Non-standard_header}}</div>
<p>在控制台中显示指定JavaScript对象的属性,并通过类似文件树样式的交互列表显示。</p>
<p>{{AvailableInWorkers}}</p>
<p><img alt="console-dir.png" class="default internal" src="/@api/deki/files/6081/=console-dir.png"></p>
<h2 id="语法">语法</h2>
<pre class="syntaxbox">console.dir(<em>object</em>);
</pre>
<h2 id="参数">参数</h2>
<dl>
<dt><code>object</code></dt>
<dd>打印出该对象的所有属性和属性值.</dd>
</dl>
<h2 id="浏览器兼容性">浏览器兼容性</h2>
{{Compat("api.console.dir")}}
<h2 id="相关链接">相关链接</h2>
<ul>
<li><a class="external" href="http://www.opera.com/dragonfly/documentation/console/">Opera Dragonfly documentation: Console</a></li>
<li><a class="external" href="http://msdn.microsoft.com/library/gg589530">MSDN: Using the F12 Tools Console to View Errors and Status</a></li>
<li><a href="https://developers.google.com/chrome-developer-tools/docs/console-api#consoledirobject">Chrome Console API reference</a></li>
</ul>
<p> </p>
|