I have a problem. I can't figure out how I can load an iframe with jQuery or Ajax, and when the content is loaded inside the iframe, then output it to the page.
The problem is that, I am loading an external page on my web site, and sometimes the external page is very slow or does not load. If that happens I don't want the browser to keep trying to load the iframe on my web site, and I don't want a big blank space.
So I need to load an external page in a iframe, without the browser loads and first when or if the content is loaded, then the iframe is showed on the website. Is this possible?
Try with "on load" like
$('#my_iframe').on('load', function(){
$(this).show();
});
put the iframe in the page:
<div id="theIframeContainer" style="display:none">
<iframe src="theSite"></iframe>
<div>
then, jquery code
$(function() {
$("#theIframeContainer").show();
}