I
I
IliaMal2021-03-29 10:51:45
JavaScript
IliaMal, 2021-03-29 10:51:45

js SCRIPT1004 error in IE 10, how to fix?

Hello.

I decided to test the site on IE 10 and found that in the console the lines where variables are set via let errors

SCRIPT1004: ';' is expected

Wherein ';' is present everywhere.
Example:
if(urlGet.type == 'success'){
        $('.success-top').addClass('active');
        let url = document.location.href.replace('/type=success/', '');
        history.pushState(null, null, url);
        setTimeout(() => {
            $('.success-top').removeClass('active');
        }, 3000)
  }

Swears at line 3 if this piece of code is removed, but finds the next let and swears at it.

What's the matter? How to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-03-29
@IliaMal

Syntax support here (enable Show obsolete platforms ). Babel .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question