3
∙ Allow Active content to run files on my computer
∙ Allow Active content from CDs
Copy and paste the following URL into your browser:
www.cs.csi.cuny.edu/~zelikovi/csc115/SimpleJavaScriptError.html
What does the webpage display ?
__________________________________________________
Look at the source code using View/Source:
Click anywhere on the page
Right click
Select from the menu, View\Source
Debug the page, by checking the first line that is not executing properly.
Copy and paste the correct code here.
______________________________________________________
What does this page do now?
________________________________________________
The prompt box is similar to the alert box that is discussed above. The prompt box
allows for user input. The prompt syntax is as follow:
var name=prompt("Please enter your name","Harry Potter");
The instruction above sets aside space in computer memory for the variable name. The
parentheses include the prompt and the default value for the location. In the example above,
“Please enter your name” is the prompt, and the default value is: Harry Potter.
You can also declare the variable and initialize the value using the following two statements:
var name;
name =prompt("Please enter your name","Harry Potter");
View this webpage in your web browser:
www.cs.csi.cuny.edu/~zelikovi/csc115/SimpleJavaScriptPrompt.html