Debugging Your JavaScript
A Note on Versions Dreamweaver MX 2004 has discontinued the debugger feature. If the version of Dreamweaver you are running is Dreamweaver MX or Dreamweaver 4, you can still use this feature. You will not find this feature in MX 2004, even though the View Options toolbar includes a tooltip that says “Preview/Debug in Browser.” In supported versions, you’ll find the Debug JavaScript button on the View Options toolbar when the Document window is in Code view or the Code inspector is launched. For further instructions, please keep reading. |
To use the JavaScript Debugger:
To watch a variable’s value:
One of the most useful ways to test any code – including JavaScript – is to set variables to really absurd values. What happens to your zodiac sign calculator, for example, when someone claims they were born in 1865? Or clicks on a button 100 times? One way to test these unlikely possibilities is to set the variables in your code directly. The Dreamweaver debugger allows you to do just that.
To set a variable’s value: