Question 1
Topic: Essential JavaScript Principles and Practices
Skill tested: Distinguishes client-side JavaScript execution from server-side processing and HTML rendering.
A travel company is separating responsibilities in a web application. The browser must update the itinerary immediately when a customer selects an option, while the application server must enforce pricing rules before accepting a booking. The team also needs to explain why a JavaScript failure in one browser should not be treated as proof that the server-side validation was bypassed. Which design best reflects the roles of client-side and server-side JavaScript?
Client-side JavaScript runs in the user's browser and can update the interface promptly, but users can disable it or alter requests. The server must therefore apply authoritative pricing and booking validation independently. A browser rendering engine does not enforce server-side rules (A), and server-side code cannot directly change an already-rendered page without sending a response or using a client-server exchange (C). Sending only rendered HTML does not make client-side validation trustworthy (D).