xcatliu / react-ie8

Make your React app work in IE8
http://react-ie8.xcatliu.com/
997 stars 162 forks source link

SCRIPT438: 对象不支持“addEventListener”属性或方法 #20

Closed luolangxiao closed 8 years ago

luolangxiao commented 8 years ago

自定义组件的时候,不知道是否是这种写法, 在IE8下报错: this.setState({flag:true},function(){ console.log(this.refs.nodeInput); this.refs.nodeInput.select(); }); // 定义的地方如下:

luolangxiao commented 8 years ago

require('es5-shim'); require('es5-shim/es5-sham'); require('console-polyfill'); require('core-js/fn/object/assign'); require('es6-promise'); const {Input} = require('antd');

这些都有加

xcatliu commented 8 years ago

报的什么错呢?

luolangxiao commented 8 years ago

你好,xcatliu. 附件是我写的树组件,报错没有多余提示。

luolangxiao@126.com

发件人: Xcat Liu 发送时间: 2016-03-17 17:54 收件人: xcatliu/react-ie8 抄送: luolangxiao 主题: Re: [react-ie8] SCRIPT438: 对象不支持“addEventListener”属性或方法 (#20) 报的什么错呢? — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub

xcatliu commented 8 years ago

邮件回复的附件我收不到

报错没有多余的提示

报错的提示是什么呢?

luolangxiao commented 8 years ago

提示就是:SCRIPT438: 对象不支持“addEventListener”属性或方法,指向的是,加粗的和xie'xie地方

e!==!0&&--ue.readyWait>0||(Ee.resolveWith(Z,[ue]),ue.fn.triggerHandler&&(ue(Z).triggerHandler("ready"),ue(Z).off("ready"))))}}),ue.ready.promise=function(e){return Ee||(Ee=ue.Deferred(),"complete"===Z.readyState||"loading"!==Z.readyState&&!Z.documentElement.doScroll?n.setTimeout(ue.ready):****(Z.addEventListener("DOMContentLoaded",c),n.addEventListener("load",c))),Ee.promise(e)},ue.ready.promise();

xcatliu commented 8 years ago

可能是因为 IE8 没有 addEventListener 方法? http://stackoverflow.com/questions/9769868/addeventlistener-not-working-in-ie8