在不同的时间间隔自动刷新 2 个 iframe

Auto refresh 2 iframes on different time interval

我的页面上有 2 个 Iframe,显示 2 个不同的页面。我只是想在不同的时间间隔自动刷新它们(第一页每 60 秒,第二页每 300 秒)。请给我一些简单且最好的解决方案。

提前致谢

您可以这样使用 javascript:

<script>
window.setInterval("reloadIFrame1();", 60000);
window.setInterval("reloadIFrame2();", 300000);

function reloadIFrame1() {
 document.frames["frameNameHere1"].location.reload();
}
function reloadIFrame2() {
 document.frames["frameNameHere2"].location.reload();
}
</script>

试试这个:-

<script>
window.setInterval("refreshIFrame1();", 60000);

function refreshIFrame1() {
 document.getElementById('FrameID1').location.reload();
}

window.setInterval("refreshIFrame2();", 300000);
function refreshIFrame2() {
 document.getElementById('FrameID2').location.reload();
}
</script>