Commit 18318b81 authored by Ross Allen's avatar Ross Allen
Browse files

Add async attribute to Twitter widget script

parent 68fc2f25
Showing with 3 additions and 1 deletion
+3 -1
......@@ -20,11 +20,13 @@
{% 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"));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment