Singaravel Vela

Singaravel Vela

  • NA
  • 120
  • 13.8k

i am getting the iframe refused error in below code

Feb 6 2020 4:42 AM
  1. <!DOCTYPE html>  
  2. <html lang="en">  
  3. <head>  
  4. <title>Bootstrap Example</title>  
  5. <meta charset="utf-8">  
  6. <meta name="viewport" content="width=device-width, initial-scale=1">  
  7. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>  
  8. <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>  
  9.   
  10. <script>  
  11. $(document).ready(function(){  
  12. let height = $(window).height();  
  13. $('#MainFrame').height(height - 20);  
  14. setInterval(function(){  
  15. var iframe = document.getElementById('MainFrame');  
  16. iframeiframe.src = iframe.src;  
  17. console.log('restored');  
  18. },10000);  
  19. });  
  20. </script>  
  21. </head>  
  22. <body>  
  23.   
  24. <div class="container">  
  25. <iframe id="MainFrame" width="100%" src="https://www.google.in/">  
  26. </iframe>  
  27.   
  28. </div>  
  29.   
  30. </body>  
  31. </html>  
Please suggest me any other idea to do this....
 
 Thanks....

Answers (1)