我創建了一個簡單的JavaScript彈出窗口,它會要求用戶等待10分鐘或繼續處理。在我的php站點,如果時間少於10分鐘,我已經提出了一個條件,那麼只有彈出窗口應該出現。我需要編寫JavaScript的另一個函數,即使在刷新頁面後也只能彈出10分鐘,之後就不會出現。由於我是JavaScript新手,我無法獲得正確的功能來克服它。真的很感謝你的幫助,感謝一段時間後的JavaScript彈出停止
這是我彈出代碼:
function confirmation() {
var answer = confirm("You are trying to payment again, please wait for 10 mins to avoid duplicate payment. Click OK to wait and Cancel to continue pay")
if (answer){
alert("Thank you for waiting,please check your mail in 10 minutes, if you did not recieve any mail, proceed to purchase again.")
document.formDealPayment.submit();
}
else{
alert("Thank You.")
}
}
廣場;在每一行末尾 – swapnesh
使用COOKIE變量和JavaScript代碼。並且在用戶刷新頁面的情況下也檢查cookie的值。 – OMG
您可以查看JavaScript計時器事件。它只能解決你一半的問題,但中途要比現在好。 [計時器事件](http://www.w3schools.com/js/js_timing.asp) –