-
Book Overview & Buying
-
Table Of Contents
PHP jQuery Cookbook
By :
Firebug can also be used to debug JavaScript in a browser. You can place breakpoints and debug the code line by line. In addition to it you can also watch variables and DOM elements changing in real time.
To put breakpoints in your JavaScript code, open Firebug either by clicking the icon in the status bar or by pressing F12.
Then click on the Script button in the Firebug toolbar. This will show a list of all the available scripts for that page.
Select a script among these and that file will be displayed in the Firebug content panel.

After a file has been selected you can put breakpoints on a line by clicking just before the line number. A breakpoint is indicated by a dark brown colour circle.
Now you are ready for debugging. In the example seen in the next screenshot—the tic-tac-toe game—place a breakpoint on line 18. It will execute whenever a column of the game is clicked upon.
Click on a column and you will see that the execution has halted on that line...
Change the font size
Change margin width
Change background colour