Use of the console in chrome Developer Tools

Source: Internet
Author: User
Tags chrome developer chrome developer tools

The console in chrome developer tools can be displayed on any panel. You can click the following button or Press ESC.

The console has many purposes, unlike other panels.

You can use the firebug command line API in the console.

Common commands:

(1) $ ("ID") displays the elements of a specific ID;

(2) $0, returns the elements of the previous review (inspect.

(3) $1, returns the last-to-Second Review element.

(4) Dir (object): displays the attributes of the DOM object and regards the Dom as a JavaScript Object.

(5) dirxml (node): nodes are displayed in HTML format, which is the same as those seen in the elements panel.

The complete API introduction is not found in chrome introduction. Refer to firebug.

Help

Returns a list of command line API commands including short descriptions.

$ (ID)

Returns a single element with the given ID.

Warning: it will ultimately change to return the first match for the given CSS selector.

$ (Selector)

Returns an array of elements that match the given CSS selector.

$ X (XPath)

Returns an array of elements that match the given XPath expression.

$0

Represents the last element selected via
Inspector.

$1

Represents the second last element selected via
Inspector.

$ N (INDEX)

Returns one of the 5 last elements selected via
Inspector. This method takes one required Parameter
index, Which represents the index of the element (starting at 0 ).

Dir (object)

Prints an interactive listing of all properties of the object. This looks identical to the view that inside
Dom panel.

Dirxml (node)

Prints the XML source tree of an HTML or XML element. This looks identical to the view inside
HTML panel. You can click on any node to inspect it in the HTML panel.

CD (window)

By default, command line expressions are relative to the top-level window of the page. Cd () allows you to use the window of a frame in the page instead.

Clear ()

Clears the console.

Copy (object)

Copies the given parameter to the clipboard. This can be a return value of a function or an object.

Inspect (object [, panelname])

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

The available tab names are "html", "stylesheet", "script", and "dom ".

Keys (object)

Returns an array containing the names of all properties of the object.

Values (object)

Returns an array containing the values of all properties of the object.

Include (URL [, alias])/include (alias)

Except des a remote script.

Debug (FN)

Adds a breakpoint on the first line of a function.

Undebug (FN)

Removes the breakpoint on the first line of a function.

Monitor (FN)

Turns on logging for all cballs to a function.

Unmonitor (FN)

Turns Off logging for all cballs to a function.

Monitorevents (object [, Types])

Turns on logging for all events dispatched to an object. The optional argument
typesMay define specific events or event types to log.

Unmonitorevents (object [, Types])

Turns Off logging for all events dispatched to an object. The optional argument
typesMay define specific events or event families, for which to turn logging off.

For a list of available event families see
Monitorevents (object [, Types]).

Profile ([title])

Turns on the Javascript profiler. The optional argument
titleContains the text to be printed in the header of the Profile report.

Profileend ()

Turns Off the Javascript profiler and prints its report.

Table (data [, columns])

This is a temporary cutconsole.table().

Tracecils (FN)

Enables tracing of specific function CILS.

Untracecils (FN)

Disables tracing of specific function CILS.

Traceall ()

Enables tracing of function cballs for a whole context.

Untraceall ()

Disables tracing of function cballs for a whole context.

 

Https://getfirebug.com: 80/wiki/index. php/command_line_api

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.