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

119
Views
SweetAlert2 - after refresh href not working

I have this thing. After I refresh the page the script is stop working. How do I need to do it to be working?

<a onclick="confirmation(event)" href="{{ url('trash/delete/'.$items->id) }}"> Delete</a>

This is the script

<script>
function confirmation(e) {
    e.preventDefault();

    var url = e.currentTarget.getAttribute('href')
    
    Swal.fire({
        icon: 'warning',
        title: 'Are you sure?',
        text: 'This action cannot be undone!',
        showCancelButton: true,
        confirmButtonColor: '#3085d6',
        cancelButtonColor: '#d33',
        confirmButtonText: 'Yes, recall!'
        
    }).then((result) => {
        if (result.value) {
            window.location.href=url;
            
        }
    })
    
}

</script>

i have try this : location.reload(); in multilocation, but not working

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

your code works for me using this library

<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>

can you try with this and see if it will work?

about 4 years ago · Juan Pablo Isaza 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!