Inspect

From FirebugWiki

(Difference between revisions)
Jump to: navigation, search
(Added description of syntax, hint for needing help and linked back to Command Line API)
m (Added categories)
 
(One intermediate revision not shown)
Line 1: Line 1:
-
{{needsHelp}}
 
-
 
Inspects an object in the most suitable panel, or the panel identified by the optional argument <code>panelName</code>.
Inspects an object in the most suitable panel, or the panel identified by the optional argument <code>panelName</code>.
-
 
-
The available panel names integrated into Firebug are "html", "stylesheet", "script", "dom", "net" and "cookies" (though the [[Net Panel]] and the [[Cookies Panel]] currently don't support inspecting).
 
== Syntax ==
== Syntax ==
Line 9: Line 5:
inspect(object[, panelName])
inspect(object[, panelName])
</source>
</source>
 +
 +
== Parameters ==
 +
=== object ===
 +
The object to inspect. '''(required)'''
 +
 +
=== panelName ===
 +
Name of the panel to inspect the object in. (optional)
 +
 +
The available panel names integrated into Firebug are <code>html</code>, <code>stylesheet</code>, <code>script</code>, <code>dom</code>, <code>net</code> and <code>cookies</code>. (Though the [[Net Panel]] and the [[Cookies Panel]] currently don't support inspecting).
 +
 +
If the panel name is not given, the most appropriate panel will be chosen.
 +
 +
== Examples ==
 +
<source lang="javascript">
 +
inspect(document)
 +
</source>
 +
 +
Inspects the <code>document</code> property inside the [[DOM Panel]].
 +
 +
<source lang="javascript">
 +
inspect(document.body.firstElementChild)
 +
</source>
 +
 +
Inspects the first element child of the <code>&lt;body&gt;</code> tag inside the [[HTML Panel]].
 +
 +
<source lang="javascript">
 +
inspect(document.styleSheets[0].cssRules[9])
 +
</source>
 +
 +
Inspects the 10th rule of the first CSS stylesheet inside the [[CSS Panel]].
 +
 +
<source lang="javascript">
 +
inspect(myFunction, "script")
 +
</source>
 +
 +
Inspects the function <code>myFunction</code> inside the [[Script Panel]]. If the second parameter wouldn't be specified, the function would be inspected inside the [[DOM Panel]].
== See also ==
== See also ==
* [[Command Line API]]
* [[Command Line API]]
 +
 +
[[Category:Firebug]]
 +
[[Category:UI]]
 +
[[Category:API]]

Latest revision as of 00:04, 22 November 2013

Inspects an object in the most suitable panel, or the panel identified by the optional argument panelName.

Contents

[edit] Syntax

inspect(object[, panelName])

[edit] Parameters

[edit] object

The object to inspect. (required)

[edit] panelName

Name of the panel to inspect the object in. (optional)

The available panel names integrated into Firebug are html, stylesheet, script, dom, net and cookies. (Though the Net Panel and the Cookies Panel currently don't support inspecting).

If the panel name is not given, the most appropriate panel will be chosen.

[edit] Examples

inspect(document)

Inspects the document property inside the DOM Panel.

inspect(document.body.firstElementChild)

Inspects the first element child of the <body> tag inside the HTML Panel.

inspect(document.styleSheets[0].cssRules[9])

Inspects the 10th rule of the first CSS stylesheet inside the CSS Panel.

inspect(myFunction, "script")

Inspects the function myFunction inside the Script Panel. If the second parameter wouldn't be specified, the function would be inspected inside the DOM Panel.

[edit] See also

Personal tools