How to make the iframe itself prescribe src when loading the page, and inside the html tag, for example onload="this.src='http://site.ru;'" reboots forever, you need without jquery

  • I did not understand the problem. What is not suitable to write src as it should be, in html? Is he dynamic? Do you need to prescribe the src iframe when loading the iframe itself or, nevertheless, when loading the current page? - Ivan Pshenitsyn

1 answer 1

 <!DOCTYPE html> <html> <body> <iframe id="myFrame"></iframe> <script> document.getElementById("myFrame").src = "http://www.cnn.com"; </script> </body> </html> 
You can register this way. Just give the code itself that does not work, with a mark where and what to insert