在 IE11 中消除“对象不支持此操作”
Debounce 'object doesn't support this action' in IE11
此错误发生在 React 应用程序中:
- 函数调用
componentWillUpdateProps
,然后调用另一个使用 lodash 的函数 _.debounce(
- 在其他浏览器中,代码运行正常,但在IE11中,它抛出错误:
Object doesn't support this action
,接着是类型错误Unable to get property 'localName' of undefined or null reference
,第二个错误指向运行时生成的代码
我已经找出错误并确定是 _.debounce
的使用导致了错误。
我的问题是,IE11不支持debounce
吗?
原来这个问题与Debounce无关,但是,由于IE11不支持名为new Event
的代码。 document.createEvent
可以用作解决方法
此错误发生在 React 应用程序中:
- 函数调用
componentWillUpdateProps
,然后调用另一个使用 lodash 的函数_.debounce(
- 在其他浏览器中,代码运行正常,但在IE11中,它抛出错误:
Object doesn't support this action
,接着是类型错误Unable to get property 'localName' of undefined or null reference
,第二个错误指向运行时生成的代码
我已经找出错误并确定是 _.debounce
的使用导致了错误。
我的问题是,IE11不支持debounce
吗?
原来这个问题与Debounce无关,但是,由于IE11不支持名为new Event
的代码。 document.createEvent
可以用作解决方法