blob: 591a4cd624c5fd7786cb926550cd3a102e9ffa9c (
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
76
77
|
---
title: Informação Detalhada
slug: Tools/Consola_da_Web/Rich_output
translation_of: Tools/Web_Console/Rich_output
---
<div>{{ToolsSidebar}}</div>
<p>Quando a consola da Web imprime objetos, esta inclui um conjunto de informação mais rico do que apenas o nome do objeto. Em particular, esta:</p>
<ul>
<li><a href="/en-US/docs/Tools/Web_Console/Rich_output#Type-specific_rich_output">provides extra information for certain types</a></li>
<li><a href="/en-US/docs/Tools/Web_Console/Rich_output#Examining_object_properties">enables detailed examination of the object's properties</a></li>
<li><a href="/en-US/docs/Tools/Web_Console/Rich_output#Highlighting_and_inspecting_DOM_nodes">provides richer information for DOM elements, and enables you to select them in the Inspector</a></li>
</ul>
<h2 id="Type-specific_rich_output">Type-specific rich output</h2>
<p>The Web Console provides rich output for many object types, including the following:</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="Examining_object_properties">Examining object properties</h2>
<p>When an object is logged to the console it appears in italics. Click on it, and you'll see a new panel appear containing details of the object:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/7381/commandline-inspecting.png" style="display: block; margin-left: auto; margin-right: auto;">To dismiss this panel press <kbd>Esc</kbd>..</p>
<h2 id="Highlighting_and_inspecting_DOM_nodes">Highlighting and inspecting DOM nodes</h2>
<p>If you hover the mouse over any DOM element in the console output, it's highlighted in the page:</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/en-US/docs/Tools/Page_Inspector">Inspector</a> with that node selected.</p>
|