HTML and CSS Reference
In-Depth Information
Correct answer: A
3.
Correct: Checking for null prevents the use of an object before it initializes and
prevents unexpected results.
A.
Incorrect: NaN is a different construct than null.
B.
Incorrect: Custom errors aren't related to checking for null. Throwing a custom
error can be used in many different scenarios.
C.
Objective 2.4: Thought experiment
The concept of real-time chat or real-time communications isn't new. However, HTML5 Web-
Sockets make the concept easier than ever to implement in HTML5 webpages. Implementing
this type of application is beyond the scope of the topic but is very useful in understanding
the power that WebSockets provide. The following URL provides many search results that
provide examples: http://www.bing.com/search?q=WebSocket+JavaScript+chat+application.
AJAX provides asynchronous communication but doesn't provide a bidirectional function-
ality that can deliver real-time communications.
Objective 2.4: Review
Correct answer: C
1.
Incorrect: http isn't a valid WebSocket protocol.
A.
Incorrect: tcp isn't a valid WebSocket protocol.
B.
Correct: wss or ws is a valid protocol to create a WebSocket.
C.
Incorrect: ftp isn't a valid WebSocket protocol.
D.
Correct answer: C
2.
Incorrect: wsConnection.onpost isn't a method.
A.
Incorrect: wsConneciton.onreceive isn't a method.
B.
Correct: wsConnection.onmessage receives the resulting data.
C.
Incorrect: wsConnection.ongetdata isn't a method.
D.
Correct answer: C
3.
Incorrect: cache isn't required.
A.
Incorrect: cache isn't required.
B.
Correct: url , datatype , and onsuccess are required.
C.
Incorrect: oncomplete isn't a property.
D.
Search WWH ::




Custom Search