title: Sweet alert redirects before the user clicks OK
body: <p>I'm using SweetAlert2 and want to redirect the user to a different page, BUT after the success alert and the user clicks OK.</p>
  <p>this one:</p>
  <pre><code>    swal({
          title: 'Are you sure?',
          text: 'You will not be able to recover this imaginary file!',
          type: 'warning',
          showCancelButton: true,
          confirmButtonColor: '#3085d6',
          cancelButtonColor: '#d33',
          confirmButtonText: 'Yes, delete it!',
          closeOnConfirm: false
      },
      function() {
          swal(
            'Deleted!',
            'Your file has been deleted.',
            'success'
          );
      });
  </code></pre>
  <p>like this:</p>
  <pre><code>function deleteEvent(id)
  {
      swal({
          title: 'Are you sure?',
          text: 'You will not be able to recover this event!',
          type: 'warning',
          showCancelButton: true,
          confirmButtonColor: '#3085d6',
          cancelButtonColor: '#d33',
          confirmButtonText: 'Yes, delete it!',
          closeOnConfirm: false
      }).then(function() {
          swal(
            'Deleted!',
            'Your event has been deleted.',
            'success'
          );
              $.ajax({
                  url: '/events/'+id,
                  type: &quot;DELETE&quot;,
                  data:{ _token: &quot;{{csrf_token()}}&quot; },
                  success: function() {
                      location.href = '/events';
                  }
              });
      });
  }
  </code></pre>
  <p>But when the user clicks the confirm button to delete....this popup
  <a href="https://i.stack.imgur.com/pTwM8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pTwM8.png" alt="enter image description here" /></a></p>
  <p>goes right away because of my redirect and the user doesn't even get the chance to click the OK button...</p>
  <p>How can i make the redirect AFTER the user clicks the OK on this image?</p>