简体   繁体   中英

sweetalert2 Uncaught (in promise) cancel

I have looked through the examples on here and cant find a solution? What is doing my head in is I that I took the code from the developers website and only added my bit where it said I could. It loads on every brower apart from IE. Please advice as this is doing my head in. I do the error code on chrome and firefox but it loads.

the error code is : Uncaught (in promise) cancel

My code is in javascript whilst checking us a session is active

<script>

    if (!<?php echo isset($_SESSION['user_id'])?'true':'false'; ?>) {

swal({
  title: "So its your first job request?",
  text: "If you are new here, click CONTINUE to enter your personal details then your job details or click LOGIN",
  type: "info",
  showCancelButton: true,
  confirmButtonColor: '#3085d6',
  cancelButtonColor: '#d33',
  confirmButtonText: 'No, LOGIN!',
  cancelButtonText: 'CONTINUE'
}).then(function () {

 window.location.replace("login"); 
})

      $('#progress').show();
      $('#your-details').show();
      $('#status-register').show();
      $('#start2').show(); 

    } else {
      $('#your-details').hide();
      $('#status-pickup').show();  
      $('#progress').show();
      $('#pickup-details').show(); 
      $('#start1').show(); 
    }   
      $('#bottom-stuff').show();    
</script>

Any help would help me from pulling my hair out, thank you

要解决此问题,只需添加此

<script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/2.4.1/core.js"></script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM