3 ms·
What does the commented line accomplish? Edit: I am getting upvotes but no answer - it is a reasonable question. Why include it if it is commented out? Does it
by libertymcateer 10y ago
What does the commented line accomplish?
Edit: I am getting upvotes but no answer - it is a reasonable question. Why include it if it is commented out? Does it accomplish something, even though it is in comments?
Edit: answered below!
- bluesmoon 10y agoScripts injected via JavaScript are implicitly async so you don't need to specify that (at least from Firefox 4.0 and Opera 15 onwards, all other browsers have always behaved this way).
- deleted 10y ago[deleted]
- josephclay 10y agoasync[1] changes how the scripts executes so that it doesn't block the browser. [1]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptE...
- wanda 10y agoI just meant to indicate that if nothing depends on the script, you can also set the async attribute to prevent even the slightest bit of blocking. Not really necessary if you append the script to the body, but it's good to do it if you append the script to the head.
- libertymcateer 10y agoHugely helpful - thanks!