Debug

From FirebugWiki
Revision as of 01:21, 18 July 2012 by Sebastianz (Talk | contribs) (Added parameter description and examples)

Jump to: navigation, search

Adds a breakpoint on the first line of a JavaScript function.

This breakpoint can be managed via the Breakpoints Side Panel.

Syntax

debug(fn)

Parameters

fn

Function to set the breakpoint at. (required)

Examples

Having the following function:

1 function test()
2 {
3     console.log("test1");
4     console.log("test2");
5     console.log("test3");
6 }
debug(test)

This sets a breakpoint at line 3 (console.log("test1");).

See also