From the course: Building a Website with Node.js and Express.js

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Add client side JavaScript

Add client side JavaScript

From the course: Building a Website with Node.js and Express.js

Start my 1-month free trial

Add client side JavaScript

- [Daniel] We now want to leverage those API endpoints that we just created to modify our feedback page to send the form to the server using XHR, and to update the feedback shown on the page. Technically, we will first load the completely random page containing the JavaScript needed for those interactions, From then, all subsequent requests will use the REST API. This combination of initial server-side rendering and client-side updates is very common in so-called Single-Page apps. As it would be completely out of scope to cover Single-page application frameworks like React, Angular or Vue.js in this course, we will take it easy and use jQuery, a simple, but powerful, library that lets us do XHR requests and also easily lets us update the page via JavaScript. You find plenty of courses on jQuery in the library if you want to dive deeper into the topic. Our page, in fact, already uses jQuery because Bootstrap relies on it…

Contents