简体   繁体   English

在 IFRAME 上添加自动刷新

[英]Add an auto-refresh on an IFRAME

I need assistance with the below code.我需要以下代码的帮助。 I need to add something in so that it auto-refreshes on a regular basis.我需要添加一些东西,以便它定期自动刷新。 What do I need to add?我需要添加什么?

<iframe 
   src="https://docs.google.com/spreadsheets/d/e/2PACX-1vRhl6HlSXkbrMcFZBSH58Jx5_VwFqzfFr0aqWcKXs4nWVfPDjwwh4vv6pLRur0nR0SKjRShN8/pubhtml?gid=1977651099&amp;single=true&amp;widget=true&amp;headers=false"
   height=800 
   width=800>
</iframe>

I am a beginner and have no experience in coding我是初学者,没有编码经验

setInterval(()=>{
    var iframe = document.getElementById('iframe'); 
    iframe.reload(true); 
}, 1000) // reload once a second

This is my code, I hope helpful for you这是我的代码,希望对你有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM