This commit is contained in:
Joseph Cheung 2023-02-26 13:10:52 +08:00
parent 91bc5b49ca
commit 83ab4960fa
2 changed files with 4 additions and 4 deletions

View file

@ -13,7 +13,7 @@
if (timeLeft >= 0) { if (timeLeft >= 0) {
countdownEl.innerText = timeLeft; countdownEl.innerText = timeLeft;
} else { } else {
window.location.reload(true); window.location.href = window.location.href + "?timestamp=" + new Date().getTime();
} }
}, 1000); }, 1000);
</script> </script>

View file

@ -4,16 +4,16 @@
{{ icon_big('warning') }} {{ icon_big('warning') }}
<div> <div>
<p><strong>{{ _('Error!') }}</strong> {{ _('Engines cannot retrieve results.') }}</p> <p><strong>{{ _('Error!') }}</strong> {{ _('Engines cannot retrieve results.') }}</p>
<p><b>此页面将在 <span id="countdown">30</span> 秒后重试,请勿关闭浏览器。</b></p> <p><b>此页面将在 <span id="countdown">10</span> 秒后重试,请勿关闭浏览器。</b></p>
<script> <script>
let timeLeft = 30; let timeLeft = 10;
const countdownEl = document.getElementById("countdown"); const countdownEl = document.getElementById("countdown");
setInterval(() => { setInterval(() => {
timeLeft--; timeLeft--;
if (timeLeft >= 0) { if (timeLeft >= 0) {
countdownEl.innerText = timeLeft; countdownEl.innerText = timeLeft;
} else { } else {
window.location.reload(true); window.location.href = window.location.href + "?timestamp=" + new Date().getTime();
} }
}, 1000); }, 1000);
</script> </script>