AJAX

Watch the videos below, and code along with the videos. Do the exercises between videos.

Sending file

Exercise: Make a text box and button for the user to send a chat message. Do NOT add a stylesheet or script yet.

Static files

Exercise: Link your stylesheet and script to your HTML. Add an event listener to the send button.

Creating request

Sending request

Viewing request

Exercise: Make an endpoint on the server to post a chat message. Respond with "ok" and view the response in the network panel.

Parsing request

Exercise: Store the chat messages on the server. Make an endpoint on the server to get the messages. Do NOT show the messages on the page yet. For now, view the messages by typing the route in the address bar.
Last section Next section