【问题标题】:“Violation readystatechange handler took 760ms” After Updating Chrome更新 Chrome 后“违反 readystatechange 处理程序花费了 760 毫秒”
【发布时间】:2017-09-02 14:47:29
【问题描述】:

更新Google Chrome v57.0.2987后, 打开Collorbox时,我们的网站出现错误:

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.

    [Violation] 'readystatechange' handler took 760ms
    [Violation] Forced reflow while executing JavaScript took 51ms
    [Violation] Forced reflow while executing JavaScript took 43ms
    [Violation] Forced reflow while executing JavaScript took 38ms

这只是偶尔发生。当我们遇到这些错误时,Colorbox 对我们不起作用。

谷歌浏览器可能有错误吗?

编辑: Magento 合并 JavaScript 导致错误。这是行不通的。如果我不合并它们,那么我就不会收到这些错误并且它正在正确加载。

VM23586:4 Uncaught TypeError: Cannot set property 'value' of null  at choose (eval at <anonymous> (0a9e2e3….js:11743), <anonymous>:4:73)  at HTMLImageElement.onclick (letto-moderno-imbottito-prisma.html:1)
Uncaught TypeError: Cannot read property 'close' of undefined  at HTMLDivElement.onclick (letto-moderno-imbottito-prisma.html:1)

【问题讨论】:

标签: javascript google-chrome typeerror magento-1.9 colorbox


【解决方案1】:

Chrome 只是说你的代码is blocking the UI too much

【讨论】:

  • 我遇到了同样的问题。在单击按钮时,我通过弹出窗口成为alerting 用户,并且弹出窗口将一直留在那里,直到用户单击“确定”。我将alert 函数调用更改为console.log,现在可以了。
猜你喜欢
  • 1970-01-01
  • 2022-06-17
  • 2017-07-02
  • 2017-10-06
  • 2021-05-06
  • 1970-01-01
  • 1970-01-01
  • 2018-02-24
相关资源
最近更新 更多