Java Reference
In-Depth Information
9.
You've already seen this in action, so really you want to step over it and go to the next line.
Well, no prizes for guessing that Step Over is what you need to do. Click the Step Over icon (or
press the F10 key) and the function will be executed, but without stepping through it statement
by statement. You should fi nd yourself back at the document.write(“</p>”) line.
If you've fi nished debugging, you can run the rest of the code without stepping through each line by
clicking the Continue icon (or pressing F8) on the toolbar. You should see a page of times tables from
1*1=1 to 11*12=132 in the browser.
The Console
While you're stepping through code and checking its fl ow of execution, what would be really useful is the
ability to evaluate conditions and even to change things on the fl y. You can do these things using the console.
Follow these steps:
1.
Remove the previously set breakpoint by clicking the red circle in the source code panel and
set a new breakpoint at line 17:
document.write(writeString);
2.
Let's see how you can fi nd out the value currently contained in the variable writeString .
Reload the page. When the debugger stops at the breakpoint, click the Console tab, click in the
“>>>” fi eld, and type the name of the variable you want to examine, in this case writeString .
Press the Enter key. This will cause the value contained in the variable to be printed below
your command in the command window, as shown in Figure 4-11.
Figure 4-11
Search WWH ::




Custom Search