Client-side Rendering vs. Server-side Rendering
Using client-side or server-side rendering depends on an application’s type. We'll learn all about both in this lesson.
We'll cover the following...
Client-side rendering
A website that uses client-side rendering will have the server send a mostly empty HTML file to begin with. It will have links to CSS in the <head>
. It will also have links to JavaScript in the <script>
just before the closing </body>
tag. The <body>
will otherwise be empty. This is to stop JavaScript loading from blocking content loading. So, the content is loaded and the scripts are loaded next.
An alternative to this is to use async
in the script tag, like so: ...