Handle <iframe> onload event - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:IFrame

Description

Handle <iframe> onload event

Demo Code

ResultView the demo in separate window

<html>
   <head></head>
   <body> 
      <script>
function my_code(){
   console.log(" working");
}
var iframe = document.createElement("iframe");
iframe.src = "http://java2s.com";
document.body.appendChild(iframe);
iframe.onload=my_code;

      </script>  
   </body>/*from ww w  .j  a  va2 s. co  m*/
</html>

Related Tutorials