Javascript examples for DOM HTML Element:IFrame
Load url from same domain to iframe
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {//from w w w . j ava 2 s . co m var url="http://same domain/test"; var iframe=document.createElement("iframe"); iframe.onload=function() { console.log(iframe.contentWindow.document.body.innerHTML); } iframe.src=url; iframe.style.display="none"; document.body.appendChild(iframe); }); </script> </head> <body> </body> </html>