簡體   English   中英

如何創建重試連接按鈕? HTML / JS

[英]How to create retry connecting button? HTML/JS

問題是如何創建一個重試與網站的連接的按鈕。 不工作是:

<a href="the page you are currently on">Retry/Refresh</a>

嘗試window.location.reload(true)

文件資料

工作代碼應為:

<button onclick="retryConnect()">Retry</button>
<script>
function retryConnect(){
    location="retry.html";
}
</script>

在同一目錄中創建一個名為retry.html的文件,並將其寫入:

<p onload="loadPage()">Please wait...</p>

<script>
var delayLoad;

function loadPage() {
    delayLoad = setTimeout(showPage, 1000);
}

function showPage() {
  location="the previous page";
}
</script>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM