1

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

  • When does the error happen, when you load the page or when you click the button? – Bergi May 30 '17 at 14:48
  • Btw, you shouldn't mix JS and PHP like that. – Bergi May 30 '17 at 14:48
  • 1
    Possible duplicate of [Uncaught (in promise) cancel using SweetAlert2](https://stackoverflow.com/questions/39321621/uncaught-in-promise-cancel-using-sweetalert2) – James May 30 '17 at 19:11
  • Thanks but why not mix JS and PHP? As PHP supersedes JS what harm can it do as it is by far the quickest and easiest way to achieve what I want, unless you have any better methods? Welcome to ideas – caitlin.chambers May 30 '17 at 19:57

1 Answers1

-3

To fix this problem, just add this

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