A developer writes JavaScript code that fetches data from an API and updates the DOM without reloading the page. This approach is called what?
- A.Server push; server-side rendering ships the full JavaScript bundle before any HTML, trading a slower first paint for faster hydration
- B.Server-side rendering; the DOM is re-parsed from the original HTML on every JavaScript mutation, which is why frameworks batch updates
- C.CGI scripting
- D.AJAX (Asynchronous JavaScript and XML)
Why D is correct
AJAX (and its modern form using the Fetch API or XMLHttpRequest) allows pages to communicate with a server asynchronously, updating content without a full page reload. Server-side rendering generates the full HTML on the server.
Know someone studying for Web App Fundamentals? Send them this one.