m (Added categories)
m (Added category)
|Line 83:||Line 83:|
Revision as of 23:57, 21 November 2013
Firebug adds a global variable named "console" to all web pages loaded in Firefox. This object contains many methods that allow you to write to the Firebug console to expose information that is flowing through your scripts.
Writes a message to the console. You may pass as many arguments as you'd like, and they will be joined together in a space-delimited line.
Writes a message to the console, including a hyperlink to the line where it was called.
Writes a message to the console with the visual "info" icon and color coding and a hyperlink to the line where it was called.
Writes a message to the console with the visual "warning" icon and color coding and a hyperlink to the line where it was called.
Writes a message to the console with the visual "error" icon and color coding and a hyperlink to the line where it was called.
Tests that an expression is true. If not, it will write a message to the console and throw an exception.
Clears the console.
Prints an interactive listing of all properties of the object. This looks identical to the view that you would see in the DOM Panel.
The stack trace details the functions on the stack, as well as the values that were passed as arguments to each function. You can click each function to take you to its source in the Script tab, and click each argument value to inspect it in the DOM or HTML Panel.
Writes a message to the console and opens a nested block to indent all future messages sent to the console. Call
console.groupEnd() to close the block.
console.group(), but the block is initially collapsed.
Closes the most recently opened block created by a call to
Creates a new timer under the given name. Call
console.timeEnd() with the same name to stop the timer and print the time elapsed.
Stops a timer created by a call to
console.time(name) and writes the time elapsed.
Creates a time stamp, which can be used together with HTTP traffic timing to measure when a certain piece of code was executed.
Writes the number of times that the line of code where
count was called was executed.
Allows to log provided data using tabular layout.
consoleis an object attached to the
windowobject in the web page.
- If the page already contains a
consolevariable, it is not overwritten by Firebug's Console API.
- In Firebug Lite, the console is attached as soon as Lite is installed into the page.
The console API formerly implemented a
console.firebug property. This property was removed from the API in Firebug 1.9.0 in order to prevent sites from detecting whether a user has Firebug installed.