简体   繁体   English

sweetalert2未捕获(已承诺)取消

[英]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. 它会加载到除IE之外的所有浏览器上。 Please advice as this is doing my head in. I do the error code on chrome and firefox but it loads. 请指教,因为这正在引起我的注意。我在chrome和firefox上执行了错误代码,但已加载。

the error code is : Uncaught (in promise) cancel 错误代码为:未捕获(按承诺)取消

My code is in javascript whilst checking us a session is active 我的代码在javascript中,同时检查了我们的会话是否处于活动状态

<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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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