

IE has no language-related information in this part of the userAgent string.

However, as you can see from the screenshots, Firefox’s language information in the user-agent string is actually nn-NO.

#JS SCRIPT DEBUGGER CODE#
To create a breakpoint, you can also add the statement debugger to your code: function frmSubmit(event))$/) statements simply look for a string that is exactly two characters long, expecting a two-character language code such as en or no. Find the problem by learning which piece of code or input caused the error conditions.If necessary, use the command line to evaluate code or change variables for testing.For example, look for variables that are undefined when they should contain a value, or return “false” when you expect them to return “true.” Wait until the debugger pauses execution and makes it possible to step through the code.Run the script again by reloading the page in the browser if it’s an inline script, or by clicking a button if it’s an event handler.Set breakpoint(s) where you think interesting things may occur.Find the relevant code in the debugger’s code view pane.When investigating a specific problem, you will usually follow this process:
#JS SCRIPT DEBUGGER HOW TO#
Since the debuggers are roughly comparable in functionality, it’s easy to switch between them once you know how to use one. The label below the button says 5 + 1 51. Open Demo Enter 5 in the Number 1 text box.
#JS SCRIPT DEBUGGER SERIES#
IE8’s beta tools sometimes ignore breakpoints, and at the time this article was written, WebInspector seemed to have compatibility issues with the nightly builds of Webkit.įamiliarize yourself with multiple debugging tools-you never know in which browser the next bug will arise. Step 1: Reproduce the bug Finding a series of actions that consistently reproduces a bug is always the first step to debugging. In more recent versions of Safari, the debugger has been integrated into WebInspector.Ĭurrently, Firebug and Dragonfly are the most stable options.
