且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

JavaScript控制台中发生错误。功能可能会受到影响

更新时间:2023-11-06 14:52:34

我最近收到了同样的错误,同时在IE 11中测试了一些JavaScript代码。

I received this same error recently, while testing some JavaScript code in IE 11.

我的解决方案是减少console.log在FOR循环中打印的次数。

The solution for me was to reduce the number of times that the console.log prints from within my FOR loop.

例如,仅当索引可被20整除时才打印到控制台。

For example, printing to the console only if the index is divisible by 20.

for (var i = 0, j = 4000; i < j; i++) {
  if (i % 20 == 0) {
    console.log(i);
  }
}

(链接到jsFiddle页面也可以找到这里。)

(Link to jsFiddle page can also be found here.)