Support "defer" as well as "async"?
See original GitHub issueIt might be nice if this could handle defer
scripts as well as async
, as an option.
e.g. having a consolidated interface to allow notification either type of scripts being parsed. Would allow async
scripts to wait on defer
ones, etc.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Async & Defer - What's The Difference? - Page Speed Checklist
async and defer both load JavaScript asynchronously without render blocking, but async executes as soon as possible while defer runs in sequence toward...
Read more >How and when to use Async and Defer attributes | Zell Liew
defer waits for DOM to be loaded before it executes. This means: You should use defer if your script requires the DOM.
Read more >Eliminate Render-Blocking JavaScript with Async and Defer
Async and defer are two HTML5 attributes that allow delaying execution of scripts, eliminating blocking JavaScript. A must for performance!
Read more >Can you use both the async and defer attributes on a HTML tag?
The defer attribute may be specified even if the async attribute is specified, to cause legacy Web browsers that only support defer (and...
Read more >Efficiently load JavaScript with defer and async - Flavio Copes
if you specify both, async takes precedence on modern browsers, while older browsers that support defer but not async will fallback to defer ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yep - I guess this is a similar request to https://github.com/muicss/loadjs/issues/84 - if there’s an easy way to set those flags innately in the library, would prevent a lot of extra boilerplate needed in consumers. And should hopefully be a tiny change?
Let me think about this some more… in the mean time you can use the
before
callback to set the defer attribute: