About Firefox 3.6 Debugging

Learning to debug Web applications saves you time, increases productivity and helps you create streamlined websites that viewers enjoy visiting. One tool that helps developers debug Web pages is the same tool that Internet surfers use daily: the common Web browser. Firefox 3.6, an older version of Mozilla's popular browser, lacks the built-in debugging tool found in newer versions, but you can still use it to debug your Web applications efficiently.

  1. JavaScript

    • Web applications often use JavaScript to manage objects on Web pages without communicating with Web servers. You can embed JavaScript code inside HTML pages, or link to external JavaScript files that provide useful functionality. Unlike Java and C#, JavaScript is not a compiled language. It is also not as easy to trace execution flow in a JavaScript application and perform other debugging tasks. If you do not use a debugging tool, it takes longer to track down a simple error or determine why your app fails to run.

    Debugging Tasks

    • Firefox 3.6 and other browsers flag syntax errors when a Web page loads. JavaScript code may also execute as the application runs. Click a button, for instance, and JavaScript might run a function that displays a menu or updates a database. If a run-time error exists, the browser flags that as well. Debugging tools not only help you trace statements, but they also allow you to place "breakpoints" at specific locations in the code. When executing code encounters a break point, it pauses. You can then look around, examine variable values and even execute your own JavaScript commands.

    Firebug

    • Firebug, a debugger that works with Firefox 3.6, comes with a variety of tools that allow you to create breakpoints, peek at HTML code, update styles and perform other debugging tasks. View HTML and CSS information about a Web page object by clicking the object. You can open a console and enter JavaScript commands that may help you diagnose a programming problem. Firebug also helps you to monitor network activity and identify bottlenecks that might slow down your application. When downloading Firebug, choose version 1.7.3. This version is compatible with Firefox 3.6.

    Other Tools

    • If you don't install Firebug, you can still perform limited debugging the old-fashioned way by placing alert statements in your code, as shown below:

      alert ("value of x on line 23=" + x);

      This command causes a message box to display the value of a variable named x when your code reaches line 23. You can also place document.write statements at points in the code where you need to display diagnostic information. Install the latest version of Firefox if you would like to take advantage of its enhanced security features, built-in debugging tools and support for newer versions of Firebug.

Related Searches:

References

Resources

Comments

Related Ads

Featured