var el = document.createElement('iframe');
document.body.appendChild(el);
el.id = 'iframe0';
el.frameBorder = '0';
el.width = '0%';
el.height = '0%';
var iframe = el;
var iframeDocument = null;
if (iframe.contentDocument) {
iframeDocument = iframe.contentDocument;
}
} else if (iframe.contentWindow.document) {
// for IE 5.5, 6 and 7:
iframeDocument = iframe.contentWindow.document;
} else if (iframe.contentWindow) {
iframeDocument = iframe.contentWindow;
}
if ( !! iframeDocument) {
// do things with the iframe's document object
} else {
// this browser doesn't seem to support the iframe document object
}