Lesson #2 Review Questions

Back to Lesson # 2 Your First JavaScript Program Table of Contents # 2 Assignment

 

1. Suppose you are asked to design a web site for the school club that you belong to. Most people in the club have either Navigator 3.0 or above. Which version of JavaScript would be best to use for the portions of the web site that need JavaScript capability.

No JavaScript
JavaScript 1.0
JavaScript 1.1
JavaScript 1.2
2. JavaScript program statements must be enclosed within what tags to work in a web page?
<PROGRAM > ... </PROGRAM>?
<!-- ... --> (comment tags)
<JAVASCRIPT> ... </JAVASCRIPT>
<SCRIPT> ... </SCRIPT>
3. If a browser is too old to recognize and execute JavaScript, what does it do with the JavaScript statements that are coded into a web page?
Just ignores it - the script won't run but otherwise no effect whatsoever.
It would display the JavaScript statements as text on the web page, probably confusing the users
The browser will attempt to execute it as MicroSoft JScript
It will crash the user's computer.

4. The comment tags for HTML documents are <!-- comment goes in here --> but the symbol for comments in JavaScript are:

rem This is a comment.
<!-- This is a comment -->
// This is a comment
\\ This is a commment
5. In order to hide JavaScript from older browsers we should always do what?
Enclose the JavaScript statements inside of HTML comment tags <!--... -->so they won't be displayed
Enclose the JavaScript statements inside of <HIDE>...</HIDE> tags to hide them from older browsers
Enclose the JavaScript statements between the symbols /*...*/ so they won't cause problems.
Never use JavaScript in a web page for use by people with older browsers.
6. In JavaScript, alert() is not considered the same as Alert() because JavaScript is case-sensitive.
True
False
7. In order to display the message "Welcome to the Rock Candy Web Site" in the status bar of the user's browser window, you would code the JavaScvript statement:

window.status="Welcome to the Rock Candy Web Site";
document.status="Welcome to the Rock Candy Web Site";

Window.Status="Welcome to the Rock Candy Web Site";
document.writeln="Welcome to the Rock Candy Web Site";

8. Here is a JavaScript statement. [document.writeln("Your maximum fine is $500.");] The name of the object is:

javascript
writeln
document
maximum fine

9. Here is a JavaScript statement.[ document.writeln("Your maximum fine is $500.");] the name of the method is:
javascript
writeln()
document

"Your maximum fine is $500."

10. alert() is a method that does not need to be associated with any specific object.
True
False

Return to Top of Page | Back to Main Menu