Limited-Time Offer: Enjoy 50% Savings! Coupon code: 50OFF Use it at checkout
Skip to content

Free CIW JavaScript Specialist Exam 1D0-735 Exam Questions

Last updated: · 10 practice questions with answers and explanations

Page: 1 / 6 Total 55 questions

Want more questions? Get Premium Access.

Question 1

New Single answer

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?

Correct Answer: B. Use client-side JavaScript for responsive interface behavior and validate booking rules independently on the server.
Explanation:

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).

Question 2

New Single answer

Topic: Essential JavaScript Principles and Practices

Skill tested: Applies progressive enhancement with the noscript element when client-side scripting is unavailable.

A public information site displays emergency contact details through a JavaScript-generated panel. Visitors must still be able to obtain the phone number when scripting is disabled, but the page should retain the interactive panel for visitors whose browsers run JavaScript. The team wants to avoid presenting duplicate contact details in normal operation. Which implementation best meets these requirements?

Correct Answer: A. Include the contact number in ordinary HTML and use JavaScript to enhance its presentation when scripting is available.
Explanation:

Progressive enhancement keeps essential information available in the document's ordinary HTML, which remains accessible without JavaScript; script can then improve the presentation or interaction. A noscript element is useful for fallback content when scripting is unavailable, but it should not be the only source of essential information if the regular page can provide it. JavaScript cannot reliably execute to remove or expose content when scripting is disabled (A, B, and D).

Question 3

New Single answer

Topic: Intermediate JavaScript Programming Techniques

Skill tested: Uses browser developer tools and systematic testing to isolate JavaScript runtime errors.

A retail team reports that its checkout button works on a developer's desktop but does nothing on a subset of customer devices. The page uses ordinary JavaScript and no browser-specific plug-ins. The failure is intermittent, and the team has not yet confirmed whether the click handler runs or whether a later operation fails. Which troubleshooting step should be taken first to identify the failure efficiently?

Correct Answer: B. Inspect the browser's developer console and debugger on an affected device, then reproduce the issue and trace the handler.
Explanation:

Reproducing the issue on an affected browser and inspecting its console and debugger can reveal syntax or runtime errors, failed resource loads, and whether execution reaches the handler. This gathers evidence before changes are made. Replacing the implementation with a framework (A) or changing the interaction model (D) may conceal rather than diagnose the cause. Intermittent behavior does not establish that scripting is disabled, so a noscript message is not a targeted diagnostic step (C).

Question 4

New Multiple answers

Topic: Intermediate JavaScript Programming Techniques

Skill tested: Selects DOM APIs and event handling methods to update elements without replacing the document.

An internal dashboard receives refreshed status data every minute. Each status value has a unique element ID, and the page must update those values in place so existing event listeners and surrounding layout remain intact. The implementation must also avoid treating returned status text as markup. Which TWO approaches satisfy the requirements? Select TWO.

Correct Answer: A. Use document.getElementById for each known status element and assign the returned text through textContent.; E. Register an appropriate event handler for the refresh action and update the existing DOM nodes when it runs.
Explanation:

getElementById locates the existing nodes by their known identifiers, and textContent inserts status strings as text rather than interpreting them as HTML. A refresh event handler provides the appropriate point to apply the update while retaining the surrounding document and its existing nodes. document.write can replace or disrupt a loaded document, while replacing body.innerHTML recreates content and may remove listeners. innerHTML also interprets supplied strings as markup, contrary to the requirement.

Question 5

New Single answer

Topic: Intermediate JavaScript Programming Techniques

Skill tested: Uses form control properties to read selections and validate user input before submission.

A course registration form contains a select control for choosing a session and a text input for the attendee's email address. The submit handler must prevent submission when either value is missing, and it must read the selected session rather than the option's visible label. Which approach is most appropriate?

Correct Answer: A. Read the select element's value and the email input's value, check both for empty values, and prevent the form's default submission when validation fails.
Explanation:

A select control's value represents the value of its selected option, and a text input's value contains the entered email string. The submit handler can validate both and call preventDefault when either is missing, allowing the user to correct the form before submission. innerHTML and name do not provide the entered values (B); an index does not validate an email address (C); and submitting before validation defeats the required behavior (D).

Question 6

New Multiple answers

Topic: Applied JavaScript

Skill tested: Uses secure cookie attributes and avoids trusting client-controlled data for authorization.

A web application stores a session identifier in a cookie used by JavaScript-driven pages. The security team wants to reduce exposure to script access and cross-site request risks, and it does not want authorization decisions based on values that a user can edit in the browser. The site is served exclusively over HTTPS. Which TWO actions best address these requirements? Select TWO.

Correct Answer: A. Set the session cookie with the Secure and HttpOnly attributes, and use an appropriate SameSite policy.; C. Have the server validate the session and authorization on protected requests instead of trusting client-supplied role data.
Explanation:

Secure restricts cookie transmission to HTTPS, HttpOnly prevents JavaScript from reading the cookie, and SameSite can limit some cross-site cookie sending. The server must validate the session and authorization for protected operations because client-controlled data cannot establish authority. A readable role cookie can be modified (B), Base64 is encoding rather than access control (D), and URL parameters can expose session identifiers through browser history or other channels (E).

Question 7

New Single answer

Topic: Applied JavaScript

Skill tested: Validates form input on the client while preserving authoritative server-side validation.

A financial services site uses JavaScript to check that a transfer amount is numeric and positive before showing a confirmation screen. The organization wants to improve usability by catching common mistakes early, but it must ensure that modified requests cannot submit an invalid transfer. Which design is the most appropriate?

Correct Answer: B. Perform client-side checks for immediate feedback and repeat authoritative validation on the server before processing the transfer.
Explanation:

Client-side validation improves responsiveness by identifying common errors before a request is sent, but it is not a security boundary: users can disable scripts or construct requests directly. The server must independently validate the amount and enforce transfer rules before processing. Disabling the button or hiding the field does not make a request trustworthy (A, D). Server-side validation is essential, but removing useful client feedback is unnecessary and less usable (C).

Question 8

New Single answer

Topic: JavaScript Technology Extensions

Skill tested: Chooses asynchronous Fetch handling to retrieve data without blocking page interaction.

A public transit page retrieves arrival estimates from a same-origin endpoint. The interface should remain usable while the request is in progress, and the team is replacing older XMLHttpRequest code with the Fetch API. The response is JSON, and network failures or unsuccessful HTTP responses must be handled distinctly rather than silently displayed as valid data. Which implementation approach is best?

Correct Answer: A. Call fetch, check response.ok, parse the response with response.json(), and handle rejected promises and parsing errors.
Explanation:

Fetch is asynchronous and returns a Promise, so the page can remain responsive while the request proceeds. A fulfilled fetch Promise does not by itself mean the HTTP status was successful; checking response.ok allows the application to handle unsuccessful responses explicitly. response.json() also returns a Promise and can reject if parsing fails. Reading it synchronously is not valid (B), a synchronous request blocks the interface (C), and assuming every response is successful misses HTTP and parsing errors (D).

Question 9

New Multiple answers

Topic: JavaScript Technology Extensions

Skill tested: Configures XMLHttpRequest for asynchronous requests and handles completion and failure conditions.

A maintenance team must keep a small legacy page that uses XMLHttpRequest to retrieve a same-origin JSON report. The page must remain interactive while loading, must process the response only after the request completes successfully, and must show an error for failed HTTP responses or network errors. Which TWO implementation choices meet these requirements? Select TWO.

Correct Answer: A. Call open with the HTTP method, URL, and asynchronous flag set to true, then send the request.; C. Use the load event to inspect the HTTP status and parse the response only when the status indicates success.
Explanation:

Passing true as the asynchronous argument to open lets the browser continue processing user interaction while the request is pending. The load event occurs when a response has been received; checking its HTTP status before parsing ensures unsuccessful HTTP responses are handled rather than treated as valid reports. A synchronous request blocks the interface (B). Parsing solely because responseText exists can process an error response (D), and network errors must be reported, not treated as success (E).

Question 10

New Single answer

Topic: JavaScript Technology Extensions

Skill tested: Evaluates library tradeoffs and optimizes external script loading for page performance.

A content site uses a large JavaScript library for one small menu interaction. The menu is not required to render the initial article, and the organization wants to reduce initial page-load delays across mobile devices while retaining a conventional JavaScript implementation. Which change is the best first step?

Correct Answer: C. Remove unused library code where practical and load the required external script with defer so it executes after parsing without blocking it.
Explanation:

Reducing unused script payload and using defer for a classic external script lets the browser parse the document without waiting for that script; deferred scripts execute after parsing and before DOMContentLoaded. This is especially helpful when the interaction is not needed to render the article. A synchronous head script can block parsing (A), another library may add unnecessary weight (B), and loading a dependency only after a click can delay the interaction while also complicating initialization (D).