// Defer Iframe Loading - move src to data-src and leave src empty
function init() {
var vidDefer = document.getElementsByTagName('iframe');
for (var i=0; i<vidDefer.length; i++) {
if(vidDefer[i].getAttribute('data-src')) {
vidDefer[i].setAttribute('src',vidDefer[i].getAttribute('data-src'));
} } }
window.onload = init;
// Defer sripts by placing their calls in an internal file
// Place this script immediately before the </body>
// Keep defer.js file in root
function downloadJSAtOnload() {
var element = document.createElement("script");
element.src = "defer.js";
document.body.appendChild(element);
}
if (window.addEventListener)
window.addEventListener("load", downloadJSAtOnload, false);
else if (window.attachEvent)
window.attachEvent("onload", downloadJSAtOnload);
else window.onload = downloadJSAtOnload;
// Defer Script Files only - requires jQuery
$(window).load(function(){
$.getScript("//apis.google.com/js/platform.js");
$.getScript("//platform.linkedin.com/in.js")
});