AJAX

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. Output the chat message to the browser console when the send button is clicked.

Creating request

Sending request

Viewing request

Exercise: Make a route 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 a route on the server to get the chat messages, and view the messages in the browser.

Last topic Next topic