每 5 分钟重复一次自动刷新 IFrame
Repeat Auto Refresh IFrame every 5 minutes
我有一个 iframe,我需要每五分钟刷新一次。我有以下内容,但它只会按时刷新。我需要它每五分钟刷新一次。
<table class="auto-style7">
<tr>
<td class="auto-style4">
</td>
</tr>
<tr>
<td class="auto-style2">
<p class="auto-style13" style="text-align: center; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-indent: 0px; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">
Map does not auto-refresh. To update map you will need to manual refresh the page. (Click on warnings to get full details)</p>
<iframe width="1850" src="website url" class="auto-style8" height="650">
<script type="text/javascript">
function refreshiframe()
{
parent.frame1.location.href ="website url"
setTimeout("refreshiframe()",3000);
}
</script>
<body onload="refreshiframe();">
</iframe>
<br />
</td>
</tr>
</table>
<br />```
我找到了解决方案。通过将正确的脚本放在 iframe 之前并给 iframe 一个 id:
<script>
function reload() {
document.getElementById("ifr").src = "website url"
}
setInterval(reload, 60000)
</script>
<table class="auto-style7">
<tr>
<td class="auto-style4">
</td>
</tr>
<tr>
<td class="auto-style2">
<p class="auto-style13" style="text-align: center; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-indent: 0px; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">
Map auto-refreshes every 5 minutes. Warnings update every minute (Click on warnings to get full details).</p>
<iframe width="1850" src="website url" class="auto-style8" height="650" id="ifr"></iframe>
<br />
</td>
</tr>
</table>
<br />```
我有一个 iframe,我需要每五分钟刷新一次。我有以下内容,但它只会按时刷新。我需要它每五分钟刷新一次。
<table class="auto-style7">
<tr>
<td class="auto-style4">
</td>
</tr>
<tr>
<td class="auto-style2">
<p class="auto-style13" style="text-align: center; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-indent: 0px; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">
Map does not auto-refresh. To update map you will need to manual refresh the page. (Click on warnings to get full details)</p>
<iframe width="1850" src="website url" class="auto-style8" height="650">
<script type="text/javascript">
function refreshiframe()
{
parent.frame1.location.href ="website url"
setTimeout("refreshiframe()",3000);
}
</script>
<body onload="refreshiframe();">
</iframe>
<br />
</td>
</tr>
</table>
<br />```
我找到了解决方案。通过将正确的脚本放在 iframe 之前并给 iframe 一个 id:
<script>
function reload() {
document.getElementById("ifr").src = "website url"
}
setInterval(reload, 60000)
</script>
<table class="auto-style7">
<tr>
<td class="auto-style4">
</td>
</tr>
<tr>
<td class="auto-style2">
<p class="auto-style13" style="text-align: center; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-indent: 0px; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">
Map auto-refreshes every 5 minutes. Warnings update every minute (Click on warnings to get full details).</p>
<iframe width="1850" src="website url" class="auto-style8" height="650" id="ifr"></iframe>
<br />
</td>
</tr>
</table>
<br />```