JSFiddle - React, Tailwind, and code Playground
by Greg Yung
HTML
<h1>I'm the parent, I'll show you my iFrame if you push my buttons:</h1>
<button type="button" class="showIFrame">Click me (bad)!</button>
<button type="button" class="showIFrameFix">Click me (good)!</button>
<iframe class="hiddenOnLoad" width="100%" height="300" src="http://jsfiddle.net/pQqXc/embedded/result/" frameborder="0"></iframe>
CSS
.hiddenOnLoad {
display:none;
}
JavaScript
$(function() {
$('.showIFrame').on('click', showIFrameClick);
$('.showIFrameFix').on('click', showIFrameClickFix);
function showIFrameClick(e){
$('.hiddenOnLoad').show()
}
function showIFrameClickFix(e){
$('.hiddenOnLoad').show()
.attr('src', 'http://jsfiddle.net/pQqXc/embedded/result/');
}
});