Skip to content

Instantly share code, notes, and snippets.

@nleush
Last active October 22, 2018 16:53
Show Gist options
  • Save nleush/7e7775c9709eb3bdb6e6 to your computer and use it in GitHub Desktop.
Save nleush/7e7775c9709eb3bdb6e6 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
function loadIframelyEmbedJs() {
// Replace 'iframe.ly' with your custom CDN if available.
if (document.querySelectorAll("[data-iframely-url]").length === 0
&& document.querySelectorAll("iframe[src*='iframe.ly']").length === 0) return;
var iframely = window.iframely = window.iframely || {};
if (iframely.load) {
iframely.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);
}
}
// Run after DOM ready.
loadIframelyEmbedJs();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment