Skip to content

Instantly share code, notes, and snippets.

@elkorn
Created April 27, 2013 10:40
Show Gist options
  • Save elkorn/5472655 to your computer and use it in GitHub Desktop.
Save elkorn/5472655 to your computer and use it in GitHub Desktop.
DOM recipes
function getCleanContentHolders(argument) {
var iframe = document.createElement('iframe');
iframe.style.display = "none";
iframe = document.body.appendChild(iframe);
var _window = iframe.contentWindow;
var _document = iframe.contentDocument || iframe.contentWindow.document;
document.body.removeChild(iframe);
return {
window: _window,
document: _document
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment