Jeremiah is an in-house SEO specialist for a car rental company with locations across the U.S. He works closely with the firm's web designer, Maria, who mentions to him that she'd like to contextualize the site's homepage by displaying the nearest car rental pickup spot based on the user's location. Jeremiah thinks this is a great idea, but has concerns about how it may slow down the site. What solution could Jeremiah employ to keep the functionality while maintaining the site speed?
Choose an answer
Tap an option to check your answer.
Correct answer: Put the JavaScript that generates the site location in the HTML of the page where it's needed, and keep non-essential JavaScript in the page footer..
Why this is the answer
Placing the location-detecting JavaScript directly in the HTML ensures it loads immediately where needed, while deferring non-essential scripts to the footer reduces blocking of page rendering. This maintains functionality without compromising Largest Contentful Paint (LCP) or overall page speed. Optimizing script placement improves user experience and supports Core Web Vitals metrics.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed