admin管理员组文章数量:1399944
I have rather plex code that is executing a multiple AJAX call in sequence through the 'for' loop. This code works because I use 'Let' statement when assigning scope to a loop index. (let i = 0; i < 2; i++) { }.
However, 'Let' is giving me " Expected ';' error in Internet Explorer 11, While the code is working perfectly in other browsers. I have tried to move "let" out of the loop but it still fails, it seem to fail wherever the statement is used regardless of the loop. Please let me know what is the workaround for this as IE 11 is supposed to be patible with 'Let' statement.
I have rather plex code that is executing a multiple AJAX call in sequence through the 'for' loop. This code works because I use 'Let' statement when assigning scope to a loop index. (let i = 0; i < 2; i++) { }.
However, 'Let' is giving me " Expected ';' error in Internet Explorer 11, While the code is working perfectly in other browsers. I have tried to move "let" out of the loop but it still fails, it seem to fail wherever the statement is used regardless of the loop. Please let me know what is the workaround for this as IE 11 is supposed to be patible with 'Let' statement.
Share Improve this question asked Mar 4, 2019 at 18:55 Nemanja SovicNemanja Sovic 511 silver badge8 bronze badges 3- Are you sure your page isn't running in a patibility mode? – Pointy Commented Mar 4, 2019 at 18:57
-
1
IE11 knows
let
but it works likevar
. – Teemu Commented Mar 4, 2019 at 18:57 - Read note 5 here: caniuse./#feat=let – Randy Casburn Commented Mar 4, 2019 at 18:57
1 Answer
Reset to default 7See this ES6 support table. Internet Explorer 11 does not support let
in for/for-in loop iteration scope.
You need to take a different approach.
This answer lists a number of options you could implement manually.
You could also use a tool like Babel to transpile your ES6 or newer JavaScript into ES5.
本文标签: Internet Explorer 11 JavaScript Let StatementStack Overflow
版权声明:本文标题:Internet Explorer 11 JavaScript Let Statement - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744132371a2592236.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论