HTML and CSS Reference
In-Depth Information
Correct answer:
A
3.
Correct:
window.event.returnValue = false;
cancels the event.
A.
Incorrect:
return false;
doesn't cancel the event.
B.
Incorrect:
window.event.Return();
isn't valid.
C.
Incorrect:
window.stop();
isn't valid.
D.
Correct answer:
A
4.
Correct:
The
focus
event fires when an element receives the focus.
A.
Incorrect:
The
change
event fires when the value of an element is changed.
B.
Incorrect:
The
keydown
event fires when a keyboard key is pressed down.
C.
Incorrect:
The
mouseleave
event fires when the mouse pointer leaves the area of
an element.
D.
Objective 2.3: Thought experiment
Implementing a
try…catch
block in every function at the top of the call stack is an important
way to catch unforeseen scenarios that result in the application getting into a bad state. How-
ever, this error handling routine might include situations from which you want to be able to
recover. Nesting
try…catch
blocks allow this to happen. You can implement as many
try…catch
blocks as you want. Nesting them allows you to catch a specific scenario within the outer
block, handle it, correct data and/or assumptions, and allow the script to continue running.
Objective 2.3: Review
Correct answer:
A
1.
Correct:
By using structured error handling, you can provide feedback to users
and handle unknown situations properly.
A.
Incorrect:
Proper error handling allows users to fix problems with the webpage.
B.
Incorrect:
Proper error handling allows you to debug the application at run time.
C.
Incorrect:
Proper error handling allows you to suppress all the bugs in your scripts.
D.
Correct answer:
B
2.
Incorrect:
message
is a valid property that gives the textual description of the
error.
A.
Correct:
description
isn't a valid property.
B.
Incorrect:
The
number
property provides the number associated with the error.
C.
Incorrect:
The
name
property provides the name of the exception object.
D.
Search WWH ::
Custom Search