O'Reilly logo

Isomorphic Go by Kamesh Balasubramanian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Initializing the event listeners

Finally, we call the InitializeChatEventHandlers function, passing in the env object, to initialize the event handlers for the live chat feature:

  InitializeChatEventHandlers(env)

The InitializeChatEventHandlers function is responsible for setting up all the event listeners required by the live chat feature. There are two controls that require user interaction. The first is the message input field, where the user types and sends their questions by hitting the Enter key. The second is the close button, the X, that's found on the upper right hand corner of the chat box, used to close the live chat feature.

To handle the user interaction with the message input field, we set up the keypress event listener, which ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required