Appendix C. Exercise answers
Chapter 2. Building the page at runtime
What are the two phases in the lifecycle of a client-side web application?
The two phases in the lifecycle of a client-side web application are page building and event handling. In the page-building phase, the user interface of our page is built by processing HTML code and by executing mainline JavaScript code. After the last HTML node is processed, the page enters the event-handling phase, in which various events are processed.
What is the main advantage of using the addEventListener method to register an event handler versus assigning a handler to a specific element property?
When assigning event handlers to specific element properties, we can register only ...
Get Secrets of the JavaScript Ninja, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.