]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Add async attribute to Twitter widget script 11369/head
authorRoss Allen <rossgit@gmail.com>
Tue, 5 Nov 2013 17:39:50 +0000 (07:39 -1000)
committerRoss Allen <rossgit@gmail.com>
Tue, 5 Nov 2013 17:39:50 +0000 (07:39 -1000)
_includes/footer.html

index 14f6db9a10843477dfb0adc642d09cd52b94e1f1..56518ac49fb6039e86f2715e3e4d5fc1be436642 100644 (file)
 {% comment %}
   Inject Twitter widgets asynchronously. Snippet snipped from Twitter's
   JS interface site: https://dev.twitter.com/docs/tfw-javascript
+
+  * "js.async=1;" added to add async attribute to the generated script tag.
 {% endcomment %}
 <script>
   window.twttr = (function (d,s,id) {
     var t, js, fjs = d.getElementsByTagName(s)[0];
-    if (d.getElementById(id)) return; js=d.createElement(s); js.id=id;
+    if (d.getElementById(id)) return; js=d.createElement(s); js.id=id; js.async=1;
     js.src="https://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs);
     return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } });
   }(document, "script", "twitter-wjs"));