Skip to content

Instantly share code, notes, and snippets.

@nleush
Last active September 9, 2015 16:07
Show Gist options
  • Save nleush/9c9528252a45001b79b7 to your computer and use it in GitHub Desktop.
Save nleush/9c9528252a45001b79b7 to your computer and use it in GitHub Desktop.
Load iframe.ly/embed.js dynamically
<script type="text/javascript">
function loadIframelyEmbedJs() {
var iframely = window.iframely = window.iframely || {};
var widgets = iframely.widgets = iframely.widgets || {};
if (widgets.load) {
widgets.load();
} else {
var ifs = document.createElement('script'); ifs.type = 'text/javascript'; ifs.async = true;
ifs.src = ('https:' == document.location.protocol ? 'https:' : 'http:') + '//cdn.iframe.ly/embed.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ifs, s);
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment