Skip to content
Advertisement

SweetAlert2 syntax error on Internet Explorer 11

I’m using the exactly code of SweetAlert2 examples page:

JavaScript

Works fine on Firefox and Chrome, but Internet Explorer shows SCRIPT1002: Syntax Error and not run the script…IE flag this portion as syntax error:

JavaScript

Thanks for any help

Advertisement

Answer

(result) => {} is an arrow function which is completely unsupported in IE. To fix this you’ll have to use a traditional anonymous function:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement