January 2001
Beginner
312 pages
6h 4m
English
What is wrong with the following examples?
<html> <head> <title>A Simple Page</title> <script language="JavaScript"> <!-- Cloaking device on! var msg1 = "Hello there", num1 = 22; alert(msg11); alert(num1); // Cloaking device off --> </script> </head> <body> </body> </html>
ANSWER: The first alert() method is displaying a variable that hasn't been created or had a value assigned to it (msg11). This is an example of an undefined value.
<html> <head> <title>A Simple Page</title> <script language="JavaScript"> <!-- Cloaking device on! var msg1 = "Hello there" num1 = 22; alert(msg1); alert(num1); // Cloaking device off --> </script> </head> <body> </body> </html>
ANSWER: No comma separates the variables in ...
Read now
Unlock full access