mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-17 21:49:09 +01:00
Add async attribute to Twitter widget script
This commit is contained in:
parent
68fc2f2515
commit
18318b81b0
@ -20,11 +20,13 @@
|
|||||||
{% comment %}
|
{% comment %}
|
||||||
Inject Twitter widgets asynchronously. Snippet snipped from Twitter's
|
Inject Twitter widgets asynchronously. Snippet snipped from Twitter's
|
||||||
JS interface site: https://dev.twitter.com/docs/tfw-javascript
|
JS interface site: https://dev.twitter.com/docs/tfw-javascript
|
||||||
|
|
||||||
|
* "js.async=1;" added to add async attribute to the generated script tag.
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
<script>
|
<script>
|
||||||
window.twttr = (function (d,s,id) {
|
window.twttr = (function (d,s,id) {
|
||||||
var t, js, fjs = d.getElementsByTagName(s)[0];
|
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);
|
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) } });
|
return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } });
|
||||||
}(document, "script", "twitter-wjs"));
|
}(document, "script", "twitter-wjs"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user