Skip to content

Instantly share code, notes, and snippets.

@barneycarroll
Created September 20, 2011 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barneycarroll/1228757 to your computer and use it in GitHub Desktop.
Save barneycarroll/1228757 to your computer and use it in GitHub Desktop.
Stop iframes delaying page load
// iframes delay page load: cut them out and in to reduce synchronous dependency
function asyncFrames(){
$('iframe').each(function(){
var
markup = $(this).clone(),
guide = $('<b>').replaceAll(this);
// addLoad: https://gist.github.com/1226302
addLoad(function(){
guide.replaceWith(markup)
});
});
};
// Init:
// $(asyncFrames);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment