View Single Post
  #4 (permalink)  
Old October 4th, 2016, 11:08 PM
brsastre brsastre is offline
Registered User
Points: 26, Level: 1
Points: 26, Level: 1 Points: 26, Level: 1 Points: 26, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2016
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Deferred attribute contradici

Chapter 2, Summary:

➤ All <script> elements are interpreted in the order in which they occur on the page. The code contained within a <script> element must be completely interpreted before code in the next <script> element can begin so long as defer and async attributes are not used.

➤ You can defer a script’s execution until after the document has rendered by using the defer attribute. Deferred scripts always execute in the order in which they are specified.

Isn't there a contradiction:

- The code contained within a <script> element must be completely interpreted before code in the next <script> element can begin so long as defer and async attributes are not used.
- Deferred scripts always execute in the order in which they are specified.

So.. does defer attribute guarantees the script to be executed in the order they are specified, or not?

Thank You!
Reply With Quote