Previous Example-|-Next Example-|-Return to Chapter Listing

Example 4.3:
Undefined Variables


Click on the button to see what happens when you use text2, an undefined variable:


This is the script we used. First, we put this in the HEAD: <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- var text2 //--> </SCRIPT> Then we created this button: <form> <input type="button" value="Undefined variable, text2" onclick=alert(text2)> </form>
Previous Example-|-Next Example-|-Return to Chapter Listing