JavaScript

Create the UI

Create the user interface for your web chat.

The following HTML defines a <section> that you will use to display:

  • The name of the currently logged-in user
  • The user's current status - that is, whether they are currently typing a message
  • The messages sent and received so far
  • A text area for your user to type a new message

The web page loads three scripts once the page body has rendered:

  • The nexmoClient.js file from the nexmo-client Node module
  • The chat.js file that will contain your application's code. Create this empty file in the project's root directory

Create a file named index.html in your project directory with the following contents: