Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add option to defer script?

See original GitHub issue

I’ve tested this, and I can’t tell any difference when you add the defer to the script attribute when preloading, but it would be very easy to support passing that in as an option.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

tomwaysoncommented, Apr 3, 2017

Nice work @davetimmins - I put in a debugger and I can see that your way does indeed wait the components to be rendered before loading the JSAPI. See

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML script defer Attribute - W3Schools
The defer attribute is a boolean attribute. If the defer attribute is set, it specifies that the script is downloaded in parallel to...
Read more >
Scripts: async, defer - The Modern JavaScript Tutorial
The defer attribute tells the browser not to wait for the script. Instead, the browser will continue to process the HTML, build DOM....
Read more >
The Script element - HTML: HyperText Markup Language
Scripts with the defer attribute will prevent the DOMContentLoaded event from firing until the script has loaded and finished evaluating.
Read more >
Is there any advantage to add 'defer' to a new script tag after ...
and for your other question, yes you can add defer attribute with element.defer=true to the elements while creating and loading to DOM. Hope ......
Read more >
How to Defer Parsing of JavaScript in WordPress (4 Methods)
First, there are two attributes that you can add to your scripts: ... Look for the Load JavaScript deferred option in the JavaScript...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found