Java Reference
In-Depth Information
If you've finished 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 flow of execution, it would be really useful to
evaluate conditions and even to change things on the fly. You can do these things using the console.
Follow these steps:
1.
Remove the previously set breakpoint by clicking it and set a new breakpoint at line 15:
document.write(writeString);
2.
Let's see how you can find out the value currently contained in the variable writeString .
Reload the page. When the debugger stops at the breakpoint, click the Console tab and type
the name of the variable you want to examine, in this case writeString . Press the Enter key.
This causes the value contained in the variable to be printed below your command in the
command window, as shown in Figure 18-11.
figure 18-11  
3.
If you want to change a variable, you can write a line of JavaScript into the command
window and press Enter. Try it with the following code:
writeString = "Changed on the Fly<br />";
 
Search WWH ::




Custom Search