| Right click this window and select "view source" in order to copy the source for this script.
JavaScript Throw
View the script. This particular demonstration is designed as an error trap. To use the "throw" statement, you probably want to use a "try" and a "catch" also. If you deviate from the instructions in the prompt, with either a number lower than 1 or greater than 10, the script activates; it also activates if your entry is not a number. Otherwise, normally, if you follow the instructions, the page simply loads without incident. However, we have put in an alert to say that the option worked as it should have.
|