10
Using HTML Templates
In this chapter, I describe how templates are used to generate HTML content, allowing an application to adapt the content display to the user to reflect the request that is being processed or the application’s state data.
Like many of the topics described in this book, templates are much easier to understand once you see how they work. Therefore, I will start by creating a simple custom template system using just the features provided by the JavaScript and Node.js APIs, just to explain how the pieces fit together. I will demonstrate server-side templates, where the backend server generates the HTML content, and client-side templates, where the browser generates the content.
The custom templates in this chapter are educational ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access