admin管理员组文章数量:1321827
Hello everyone I have an issue related Internet Explorer 10 and older version,
my code is running properly in all the browser
(Chrome, Firefox, Internet Explorer 11)
but when i tried to run that in Internet Explorer 10 and 9 I am getting the error of
SCRIPT1004: Expected ';'google.map.js (1270,14)
and on that particular line i have a for loop
for (let i = 0; i < Markers.length; i++) {
and my full function
function clearMarker() {
for (let i = 0; i < Markers.length; i++) {
Markers[i].setMap(null);
}
Markers = new Array();
}
i don't understand why this error is ing in my console. and this is working fine in other browsers,
is it related to patibility of ie 10 and lesser?
Hello everyone I have an issue related Internet Explorer 10 and older version,
my code is running properly in all the browser
(Chrome, Firefox, Internet Explorer 11)
but when i tried to run that in Internet Explorer 10 and 9 I am getting the error of
SCRIPT1004: Expected ';'google.map.js (1270,14)
and on that particular line i have a for loop
for (let i = 0; i < Markers.length; i++) {
and my full function
function clearMarker() {
for (let i = 0; i < Markers.length; i++) {
Markers[i].setMap(null);
}
Markers = new Array();
}
i don't understand why this error is ing in my console. and this is working fine in other browsers,
is it related to patibility of ie 10 and lesser?
Share Improve this question edited Jan 2, 2019 at 5:48 asked Jun 29, 2018 at 6:45 user6656728user6656728 6-
8
let
is not supported in IE10. In IEs it was first introduced in IE11, but didn't create a block scope. – Teemu Commented Jun 29, 2018 at 6:45 -
2
Change from
let
tovar
...for (var i = 0; i < Markers.length; i++) {
– Asons Commented Jun 29, 2018 at 6:46 - Are you working on a node environment or writing code directly in the html/js files? – Aseem Upadhyay Commented Jun 29, 2018 at 6:51
-
You can check browser support here. caniuse./#search=let . As you can see from the URL, IE 11 is the lowest version partially supporting
let
. So you should usevar
instead. – Lewis Commented Jun 29, 2018 at 6:52 - I am working on jquery with mvc @AseemUpadhyay – user6656728 Commented Jun 29, 2018 at 6:57
1 Answer
Reset to default 9let
and const
are not valid in IE 10 or below and worse yet they don't work right in IE 11! You shouldn't use them. You should change the let
to a var
.
You can find more information at Can I use about what browsers will support it or the MDN article on let
本文标签: semicolon error in javascript for loop in internet explorer 10 and lower version of ieStack Overflow
版权声明:本文标题:semicolon error in javascript for loop in internet explorer 10 and lower version of ie - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742105441a2420996.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论