| home / programming / javascript / diaries / 3 |
|
|
Let's look at one more script, using the increment operator ( ++
). (This one is taken from JavaScript:
The Definitive Guide.) This one looks simple but is a little more complex
to describe. The main thing is to look at the work done by the increment operator:
<script type="text/javascript">
<!--
var count=0;
while (count<10) {
document.write(count + "<br>");
count++;
}
//-->
</script>
This little script will write the numbers 0-9 on your screen, each on its own separate line.
|
That wraps it up for this installment. You might want to try analyzing some smaller, ready-made scripts on your own. Many can be found in the JavaScript section of Script Search and at JavaScript Source. Perhaps in the future we will take a look at some of these scripts and apply some of our what we've learned. Even if we can't make sense of the entire script right away, we can pick out sections that we are familiar with to obtain a better understanding.
Continue on to "The JavaScript Diaries: Part 4"
| home / programming / javascript / diaries / 3 |
Created: May 13, 2005
URL: