JSFiddle - React, Tailwind, and code Playground
JavaScript
document.onclick=function() {
var popup = open("about:blank", 'bob'),
frame = $("<iframe/>").appendTo("body")[0];
setTimeout(function() {
var docs = {
popup: popup.document,
frame: (frame.contentWindow ? frame.contentWindow :
frame.contentDocument.document ? frame.contentDocument.document :
frame.contentDocument).document
},
results = $.map( docs, function( doc, label ) {
doc.open();
doc.write("<p>Hello World</p>");
doc.close();
try {
return label + ": " + $( "p", doc ).css("z-index");
} catch(x) {
return label + ": ERROR " + x.message;
}
});
popup.close();
$( frame ).remove();
alert( results.join("\n") );
}, 100);
}