2 ms·
I'm pretty sure you don't need to write the element with JavaScript. You should be able to do the following: <script async src="//..."></script> (Use 'async
by stephencelis 16y ago
I'm pretty sure you don't need to write the element with JavaScript. You should be able to do the following:
<script async src="//..."></script>
(Use 'async="async"' for XHTML.)
- rarestblog 16y agoNot that simple, won't work on most browsers. Also if script has document.write inside - will fail. http://stackoverflow.com/questions/1834077/browser-support-for-script-asynctrue http://stackoverflow.com/questions/1834077/browser-support-f...
- stephencelis 16y agoMore and more support for it every day: http://webkit.org/blog/1395/running-scripts-in-webkit/ http://webkit.org/blog/1395/running-scripts-in-webkit/ So there's also "defer," which is better-supported. The document.write issue is also an issue for JavaScript element building, but the assumption is that you won't blindly use these methods without testing, first.