How to reload a page after the OK click on the Alert Page

后端 未结 10 1493
日久生厌
日久生厌 2021-01-01 18:25

I need to reload the page after the OK button is clicked on the Alert box. I am using the following code for it

alert(\"Successful Message\");
window.locati         


        
10条回答
  •  北海茫月
    2021-01-01 18:36

    Use javascript confirm() method instead of alert. It returns true if the user clicked ok button and returns false when user clicked on cancel button. Sample code will look like this :

    if(confirm('Successful Message')){
        window.location.reload();  
    }
    

提交回复
热议问题