转:eWebEditor不支持IE8的解决方法[js报错:缺少对象 editor.js]
2010-09-26 20:56
796 查看
IE8显示JS错误,缺少对象,editor.js 132行。上网一查,原来是eWebEditor的浏览器兼容问题。以前在IE6下面是没问题的。
editor.js 132行代码是:
if (element.YUSERONCLICK) {
eval(element.YUSERONCLICK + “anonymous()”);
}
原因是ie8屏蔽了anonymous方法所以要改成onclick方法。网上的解决方法如下:(加个判断浏览器的语句)
if(navigator.appVersion.match(/MSIE (7|8)\./i)!=null){
if (element.YUSERONCLICK) eval(element.YUSERONCLICK + “onclick(event)”);
}else{
if (element.YUSERONCLICK) eval(element.YUSERONCLICK + “anonymous()”);
}
经测试,IE8和ie6下面是没问题的。但是在IE7下有问题。navigator.appVersion返回的字符串在各种IE的情况下并不与实际情况一致,比如在同时安装了IE8和以IE内核的浏览器(比如搜狗浏览器)的情况下,并不是返回MSIE 8 而是MSIE 7。因此网上这种解决办法是并不总是有效的。
现在在网上发现的一种可行办法是:
try{
if (element.YUSERONCLICK) eval(element.YUSERONCLICK + "anonymous()");
}
catch(e){
if (element.YUSERONCLICK) eval(element.YUSERONCLICK + "onclick(event)");
}
此种方法在各种IE下都是有效的。(ewebeditor好像只支持IE)。
转自:/article/5178748.html
editor.js 132行代码是:
if (element.YUSERONCLICK) {
eval(element.YUSERONCLICK + “anonymous()”);
}
原因是ie8屏蔽了anonymous方法所以要改成onclick方法。网上的解决方法如下:(加个判断浏览器的语句)
if(navigator.appVersion.match(/MSIE (7|8)\./i)!=null){
if (element.YUSERONCLICK) eval(element.YUSERONCLICK + “onclick(event)”);
}else{
if (element.YUSERONCLICK) eval(element.YUSERONCLICK + “anonymous()”);
}
经测试,IE8和ie6下面是没问题的。但是在IE7下有问题。navigator.appVersion返回的字符串在各种IE的情况下并不与实际情况一致,比如在同时安装了IE8和以IE内核的浏览器(比如搜狗浏览器)的情况下,并不是返回MSIE 8 而是MSIE 7。因此网上这种解决办法是并不总是有效的。
现在在网上发现的一种可行办法是:
try{
if (element.YUSERONCLICK) eval(element.YUSERONCLICK + "anonymous()");
}
catch(e){
if (element.YUSERONCLICK) eval(element.YUSERONCLICK + "onclick(event)");
}
此种方法在各种IE下都是有效的。(ewebeditor好像只支持IE)。
转自:/article/5178748.html
相关文章推荐
- eWebEditor不支持IE8的解决方法[js报错:缺少对象 editor.js]
- eWebEditor不支持IE8的解决方法[js报错:缺少对象 editor.js]
- eWebEditor不支持IE8的解决方法[js报错:缺少对象 editor.js]
- eWebEditor不支持IE8的解决方法[js报错:缺少或不支持对象 editor.js]
- editor.js 缺少对象的解决方法(ewebeditor 使用)
- editor.js 缺少对象的解决方法(ewebeditor 使用)
- eWebEditor不支持IE8的解决方法
- eWebEditor不支持IE8IE7火狐遨游的解决方法
- 解决eWebEditor支持IE6、IE7、IE8的三个方法
- eWebEditor不支持IE,IE8,IE7,火狐,遨游的解决方法
- eWebEditor不支持IE8的解决方法
- eWebEditor不支持IE9,IE8,IE7,火狐,遨游的解决方法
- eWebEditor不支持IE8,IE7,遨游的原因及解决方法
- eWebEditor 不支持ie7、ie8的解决方法
- eWebEditor在IE8下无法使用的解决方法
- 解决js提交form时对象不支持此属性和方法"的ie错误
- asp 下 ewebeditor 上传图片功能,在IE7,IE8 及更高版本上失效解决方法
- Ext3.3在Ie8中报错ext-all.js对象不支持此属性和方法
- 关于使用jquery时,ie8下提示对象不支持的属性或方法的解决办法