Thursday, 5 June 2014

Simple script to delay load iframe

I know there are some tools and techniques for delaying the load of javascript, but I have an iframe that I would like to delay loading until after the rest of the page has finished downloading and rendering (the iframe is in a hidden that will not be revealed until someone clicks on a particular tab on the page. Is there a way to delay the load of an iframe? 

With jquery it is easy!

either enclose your code which loads the iframe within a  
$()
or use  
$(document).ready(function(){})
these both are the same and would execute your code after the DOM is ready! Meaning your website load first after completed then your iframe shows.
e.g.
$(document).ready(function(){$('iframe#iframe_id').attr('src', 'iframe_url'); });
Complete script
<iframe id='iframe_id'></iframe>
<script type='text/javascript'>$(document).ready(function(){$('iframe#iframe_id').attr('src', 'iframe_url'); });</script>

email mailto: pretext

 <a href="mailto:designoutsourced.com+info@gmail.com?subject=Maklumat%20lanjut%20pakej&body=Hai,%20saya%20berminat%20tahu%20lebi...