Client-side rendering
Client-side Rendering happens when an HTML file runs JavaScript code in the browser in order to generate and append more HTML to the current page.
Advantages:
- Render dynamic data
- Simplicity on the server
Disadvantages:
- SEO. Websites don’t arrive as HTML to the client, so web crawlers won’t be able to easily read the website’s content.
- Pushes work onto the client. Underpowered computers and browsers may have difficulty rendering the website.
Example:
<html>
<head></head>
<body>
<script>
const p = document.createElement("p");
p.innerText = "Hello, world!";
document.body.appendChild(p);
</script>
</body>
</html>