Forked from zenorocha/multiple-3rd-party-widgets.js
Created
January 28, 2018 13:17
-
-
Save prashantsharma/9a9207402a24f8e7924fe8fad6552e2c to your computer and use it in GitHub Desktop.
Loading multiple 3rd party widgets asynchronously
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| var script, | |
| scripts = document.getElementsByTagName('script')[0]; | |
| function load(url) { | |
| script = document.createElement('script'); | |
| script.async = true; | |
| script.src = url; | |
| scripts.parentNode.insertBefore(script, scripts); | |
| } | |
| load('//apis.google.com/js/plusone.js'); | |
| load('//platform.twitter.com/widgets.js'); | |
| load('//s.widgetsite.com/widget.js'); | |
| }()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment