How to reload a page after clicked ok using sweetalert

Fil picture Fil · Mar 30, 2016 · Viewed 34.8k times · Source

Hello I have a code using sweetalert

swal("Good job!", "You clicked the button!", "success")

this code will pop-up a message and has a button okay, what I like to do is I want to refresh the page after I click the okay button.

Can I do that?

Answer

Yoshioka picture Yoshioka · Mar 30, 2016

You can try this, its work for me..

swal({title: "Good job", text: "You clicked the button!", type: "success"},
   function(){ 
       location.reload();
   }
);