ExamVeda
Login
Home
Invocation and Performance Navigation
?

Why do we need to use an onload event in the script tag after using the async attribute?

Answer & Solution
Correct Answer: Option C
When using async you don’t know when the file will be downloaded, so you can attach an onload event handler to the script tag. This will allow you to invoke or instantiate any code that will need to be run when the file is downloaded:
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.