Load iFrame after page load - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:IFrame

Description

Load iFrame after page load

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <script>
    function loadDeferredIframe() {
        var iframe = document.getElementById("my-deferred-iframe");
        iframe.src = "http://java2s.com"
    };/*from  ww w . j a v  a 2  s  .c  o m*/
    window.onload = loadDeferredIframe;

      </script> 
   </head> 
   <body> 
      <p>some content</p> 
      <iframe id="my-deferred-iframe" src="about:blank"></iframe> 
      <p>some content</p>  
   </body>
</html>

Related Tutorials