Hi I have a simple iframe, which I would like to close automatically after 30seconds. How would I do that ? Here is the iFrame im currently using <iframe src='http://www.google.com' width='700' height='700' frameborder='0' scrolling='no'> </iframe> Thankyou.
Hi I don't know but google is not showing up when I use iframe, in my little script I used one of my sites here it is: <script> function check_if_open() { var t=setTimeout("closeIframe()",30000); } function closeIframe() { var iframe = document.getElementById('someid'); iframe.parentNode.removeChild(iframe); } </script> <iframe id="someid" src="http://www.archevintes.com" width="700" height="700" frameborder="0" scrolling="no" onload="check_if_open()"> </iframe>
Hi Thanks for the message This section does not seem to work, The iframe is blank. <iframe id="someid" src="http://www.archevintes.com" width="700" height="700" frameborder="0" scrolling="no" onload="check_if_open()"> </iframe> Thanks
Hi One question, the above code works but the 30 second count down does not start until the iframe page has completely loaded. Is there anyway to make the count down start straight away, so the iframe will close in 30 seconds even if it has not fully loaded ? thankyou again
Try this <script> onload=function() { var t=setTimeout("closeIframe()",30000); } function closeIframe() { var iframe = document.getElementById('someid'); iframe.parentNode.removeChild(iframe); } </script> <iframe id="someid" src="http://www.archevintes.com" width="700" height="700" frameborder="0" scrolling="no" > </iframe>
I still don'y see any difference, the timer still start also after full iframe load, nothing change did i miss something
Hi It mostly working for me, there is still about a 5 seconds delay, but that's close enough to my needs. If there is a solution to having no delay, that would be great. Thanks