aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/tools/web_console/rich_output/index.html
blob: d09757cfa2a21c478a3315924fc3cabb5d35f95b (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---
title: 豐富的輸出對象
slug: Tools/Web_Console/Rich_output
translation_of: Tools/Web_Console/Rich_output
---
<p>當網路主控台印出物件時,它不但會顯示物件名、還會包括該物件資訊的 richer set。尤其是它要:</p>

<ul>
 <li><a href="/zh-TW/docs/Tools/Web_Console/Rich_output#Type-specific_rich_output">提供某些類型的額外資訊</a></li>
 <li><a href="/zh-TW/docs/Tools/Web_Console/Rich_output#Examining_object_properties">開啟物件屬性的詳細檢查</a></li>
 <li><a href="/zh-TW/docs/Tools/Web_Console/Rich_output#Highlighting_and_inspecting_DOM_nodes">為 DOM 元素提供 richer information,並讓你能在檢查中選擇。</a></li>
</ul>

<h2 id="特定類型的_rich_output">特定類型的 rich output</h2>

<p>網路主控台給許多物件類型提供了 rich output,包括:</p>

<table class="standard-table">
 <tbody>
  <tr>
   <td><code>Object</code></td>
   <td><img alt="" src="https://mdn.mozillademos.org/files/9597/web-console-object.png" style="display: block; height: 39px; margin-left: auto; margin-right: auto; width: 600px;"></td>
  </tr>
  <tr>
   <td><code>Array</code></td>
   <td><img alt="" src="https://mdn.mozillademos.org/files/9589/web-console-array.png" style="display: block; height: 38px; margin-left: auto; margin-right: auto; width: 600px;"></td>
  </tr>
  <tr>
   <td><code>Date</code></td>
   <td><img alt="" src="https://mdn.mozillademos.org/files/9591/web-console-date.png" style="display: block; height: 39px; margin-left: auto; margin-right: auto; width: 600px;"></td>
  </tr>
  <tr>
   <td><code>Promise</code></td>
   <td>
    <div class="geckoVersionNote">
    <p>New in Firefox 36</p>
    </div>
    <p><img alt="" src="https://mdn.mozillademos.org/files/9599/web-console-promise.png" style="display: block; height: 76px; margin-left: auto; margin-right: auto; width: 600px;"></p>
   </td>
  </tr>
  <tr>
   <td><code>RegExp</code></td>
   <td><img alt="" src="https://mdn.mozillademos.org/files/9601/web-console-regexp.png" style="display: block; height: 39px; margin-left: auto; margin-right: auto; width: 600px;"></td>
  </tr>
  <tr>
   <td><code>Window</code></td>
   <td><img alt="" src="https://mdn.mozillademos.org/files/9603/web-console-window.png" style="display: block; height: 38px; margin-left: auto; margin-right: auto; width: 600px;"></td>
  </tr>
  <tr>
   <td><code>Document</code></td>
   <td><img alt="" src="https://mdn.mozillademos.org/files/9593/web-console-document.png" style="display: block; height: 39px; margin-left: auto; margin-right: auto; width: 600px;"></td>
  </tr>
  <tr>
   <td><code>Element</code></td>
   <td><img alt="" src="https://mdn.mozillademos.org/files/9595/web-console-element.png" style="display: block; height: 39px; margin-left: auto; margin-right: auto; width: 600px;"></td>
  </tr>
  <tr>
   <td><code>Event</code></td>
   <td><img alt="" src="https://mdn.mozillademos.org/files/14434/webconsole-events.png" style="height: 51px; width: 600px;"></td>
  </tr>
 </tbody>
</table>

<h2 id="檢查物件屬性">檢查物件屬性</h2>

<p>當控制台印出一個物件的時候,它會以斜體的樣式呈現。點擊它,你會看到一個有該物件詳細資訊的面板:
</p>

<p><img alt="" src="https://mdn.mozillademos.org/files/7381/commandline-inspecting.png" style="display: block; margin-left: auto; margin-right: auto;">要關閉此面板請按 <kbd>Esc</kbd> 鍵...</p>

<h2 id="高亮顯示與_DOM_節點檢查">高亮顯示與 DOM 節點檢查</h2>

<p>若你在控制台印出的 DOM 元素上懸停游標,頁面會高亮該元素:</p>

<p><img alt="" src="https://mdn.mozillademos.org/files/7379/commandline-highlightnode.png" style="display: block; margin-left: auto; margin-right: auto;">In the screenshot above you'll also see a blue "target" icon next to the node in the console output: click it to switch to the <a href="https://developer.mozilla.org/zh-TW/docs/Tools/Page_Inspector">Inspector</a> with that node selected.</p>