Vidyalelo
JavaScript · Q72

Invocation And Performance Navigation

Programming · JavaScript · question 72

Q72

Where is the external JavaScript placed in the case of lazy loading?

A.
After window.onload event
Answer
B.
Before window.onload event
C.
All of the mentioned
D.
None of the mentioned

Answer: Option A

Solution

Answer: Option A
Solution:
When we don’t need our JavaScript code to be available as soon as the page loads, we can script-load our external JavaScript after the window.onload event.