Sandbox iframe location changing - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:IFrame

Description

Sandbox iframe location changing

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){/*w  ww.  ja  v  a2 s .  com*/
var frame = document.getElementById("myframe");
var fdoc = frame.contentDocument;
fdoc.write("Hello world"); // or whatever
    }

      </script> 
   </head> 
   <body> 
      <iframe sandbox="allow-scripts allow-same-origin" id="myframe" src="about:blank"></iframe>  
   </body>
</html>

Related Tutorials