Java Reference
In-Depth Information
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>Debug: Times Table</title>
<script type=”text/javascript”>
function writeTimesTable(timesTable)
{
var counter;
var writeString;
for (counter = 1; counter < 12; counter++)
{
writeString = counter + “ * “ + timesTable + “ = “;
writeString = writeString + (timesTable * counter);
writeString = writeString + “<br />”;
documents.write(writeString);
}
}
</script>
</head>
<body>
<script type=”text/javascript”>
writeTimesTable(2);
</script>
</body>
</html>
Save this as debug_timestable.htm .
The next section walks you through the features and functionality of the Firebug add-on for Firefox.
Because of the universal nature of debugging and debuggers, the sections for Internet Explorer, Safari,
and Opera will merely familiarize you with the UI for each browser's debugger and point out any
differences.
Debugging in Firefox with Firebug
For years, the only JavaScript debugger for Firefox was a Mozilla project codenamed Venkman. Its
feature-set resembled that of Microsoft's Script Editor, but many developers felt Venkman wasn't user-
friendly. One such developer, Joe Hewitt, decided to write his own debugger using the built-in debugging
API (application programming interface) in Firefox. He christened his creation Firebug, and the rest, as
they say, is history. Today, Firebug is the defacto JavaScript debugger (and much more!) for Firefox, and
all other JavaScript (and web development) tools for other browsers are based, in principle, on Firebug.
Unfortunately, Firebug does not come with Firefox by default. Instead, you have to install the Firebug
addon. You can download the latest version of Firebug from http://www.getfirebug.com , from
Joe Hewitt's website at http://www.joehewitt.com/software/firebug/ , or from Mozilla's add-on
site at https://addons.mozilla.org/en-US/firefox/addon/1843 .
To install Firebug, open Firefox and go to either of the provided URLs. Click the Install button on the
web page, and follow the instructions. Be sure to restart Firefox after Firebug's installation.
Search WWH ::




Custom Search