Java Reference
In-Depth Information
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 />”
4.
Click the Script tab, and remove the breakpoint by clicking the red circle and then clicking the
Continue icon. You see the results of your actions: where the 1*1 times table result should be,
the text you changed on the fl y has been inserted.
This alteration does not change your actual HTML source fi le, just the page currently loaded in the
browser.
The console can also evaluate conditions. Recreate the breakpoint on line 26 and reload the page. Leave
execution stopped at the breakpoint, and Step Into the for loop's condition.
Type the following into the command window and press Enter:
timesTable <= 12
Because this is the fi rst time the loop has been run, as shown in Figure 4-12, timesTable is equal to 1
so the condition timesTable <= 12 evaluates to true .
Figure 4-12
You can also use the console to access properties of the Browser Object Model (something we'll cover
in Chapter 6). For example, if you type window.location.href into the command window and press
Enter, it will tell you the web page's URL.
Search WWH ::




Custom Search