t4t5 / sweetalert

A beautiful replacement for JavaScript's "alert"
https://sweetalert.js.org
MIT License
22.4k stars 2.84k forks source link

SweetAlert in IE11 #813

Closed irajchardoli closed 6 years ago

irajchardoli commented 6 years ago

HI , Im using sweetalert latest version , The below code in IE11 not working , and give syntax error:

swal("Click on either the button or outside the modal.").then((value) => {swal(The returned value is: ${value});});

please help me how to fix this error ?

t4t5 commented 6 years ago

Hi @irajchardoli. IE11 does not support some modern ES6 features like arrow functions and promises.

To fix it, you should either compile your code with Babel, or use a Promise-polyfill with some older syntax:

swal("Hello")
.then(function(value) {
  swal("The returned value is " + value)
})