Compartilhar via


Methods

This section describes the methods associated with the Console Debugging API.

In this section

Topic Description

assert

Sends a message to the console if the expression provided evaluates to false. The message text color is red and it is prefaced by an error icon.

clear

Clears messages from the console.

count

Create an incrementable counter that prints its value to the console. Use different countTitle parameters to create different counters.

debug

An alias of console.log.

dir

Prints the properties of an object to the console.

dirxml

Logs an XML node object to the console.

error

Sends an error "message" to the console. The message text color is red and it is prefaced by an error icon.

group

Begins a collapsible group of console output. Initially displays expanded.

groupCollapsed

Begins a collapsible group of console output. Initially displays collapsed.

groupEnd

Ends the grouping started with a group or groupCollapsed method.

info

Sends an informational "message" to the console. The message is prefaced by an information icon.

log

Sends a log "message" to the console. The message is prefaced by the string "LOG".

msIsIndependentlyComposed

Retrieves a Boolean value indicating whether the element is independently composed.

profile

Starts recording profile information under the optional title provided. This command is equivalent to clicking the Start profiling button on the F12 developer tools Profile tab.

profileEnd

Stops recording profile information under the last report title.

time

Starts a timer. If you do not specify a name parameter, the name "default" will be used.

timeEnd

Ends a timer that was set using console.time() and logs the elapsed time to the console. If you do not specify a name parameter, the name "default" will be used.

timeStamp

Outputs a timestamp to the Console based on how long the current browser tab has been open. If used while a UI Responsiveness profiling session is recording, it will also create a user mark in the session timeline similar to a performance.mark.

trace

Logs a stack trace to the console.

warn

Sends a warning message to the console. The message is prefaced by the warning icon.