Home  >  Forum  >  JavaScript
Post New Query

Difference between async and defer in JavaScript


joined on
April 13,2016
Asked on April 13,2016
What is difference between async and defer in JavaScript?
When to use defer and when to use async?
joined on
October 10,2013
Replied on April 13,2016

<script async>: It is a boolean attribute and once set, script loading takes place parallel to HTML parser. Once script loading is finished, HTML parser is stopped and script execution started. Once script execution completed, HTML parser is started again. 

<script defer> : It is a boolean attribute and once set, script loading takes place parallel to HTML parser. Once script loading is completed, it waits for HTML parser completion. After HTML parser completed, script execution is started and completed.

Write Answer









Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us