HTML and CSS Reference
In-Depth Information
Correct answer: A
4.
Correct: Wiring up events with jQuery allows you to assign the event listener to
many elements at once by using the selector syntax.
A.
Incorrect: jQuery provides much more flexibility.
B.
Incorrect: jQuery doesn't work differently inside a loop.
C.
Incorrect: This isn't unique to jQuery.
D.
Objective 2.5: Thought experiment
For an application such as this, you must consider the amount of work required to get it done.
The larger the show, the more intense the application will be. You could use setInterval and
setTimeout to control the show's flow. However, the actual delivery of the firework display and
explosion would be suited nicely for a web worker. This allows the user interface thread to
continue to work uninterrupted while the complex logic of animating the fireworks occurs on
a worker.
Objective 2.5: Review
Correct answer: C
1.
Incorrect: postMessage initiates the script to run in the worker.
A.
Incorrect: onmessage is the event handler used to receive the messages across the
worker boundaries.
B.
Correct: close isn't a method on the web worker.
C.
Incorrect: terminate is used to cancel a web worker.
D.
Correct answer: B
2.
Incorrect: close doesn't cancel a web worker.
A.
Correct: terminate cancels a web worker.
B.
Incorrect: suspend isn't a valid method.
C.
Incorrect: sleep isn't a valid method.
D.
Correct answer: C
3.
Incorrect: The code must be in its own file.
A.
Incorrect: The code can't be inside a <script> block.
B.
Correct: The code must be in its own JavaScript file, and the name of the file is
passed to the web worker as a parameter.
C.
Incorrect: There is no such property as self.worker .
D.
Search WWH ::




Custom Search