Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

2.2K
Views
How to reload a page after clicked ok using sweetalert

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?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

You can try this, it works for me.

swal({
       title: "Good job", 
       text: "You clicked the button!", 
       type: "success"
     },
   function(){ 
       location.reload();
   }
);
over 4 years ago · Santiago Trujillo Report

0

The answer from Yoshioka did not work for me, I did this and it worked perfectly:

swal({title: "Good job", text: "You clicked the button!", type: 
"success"}).then(function(){ 
   location.reload();
   }
);
over 4 years ago · Santiago Trujillo Report

0

Use the callback function...

Swal.fire({
  // Swal Setting's
}).then((result) => {
  // Reload the Page
  location.reload();
});
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!