ckeditor4.6.2在extjs2的tab页,报错this.document.getWindow().$.getSelection() undefined
来源:互联网 发布:js获取json中的键值 编辑:程序博客网 时间:2024/06/12 14:57
公司项目比较老,前端框架用的还是老掉牙的extjs2。公司需求是要将老版本的fckeditor换掉,并且整合自己开发的资源管理子系统,用以管理项目中静态资源,包括上传和调用。
采用ckeditor4.6.2,通过添加插件的方式,换掉了原始的图片、附件上传等,整合了资源管理子系统。当时在想,到了这一步应该就完成一大半了吧。当时没成想,坑才刚刚开始。在将ckeditor4.6.2整合到extjs2的一个tab页面中的时候,editor.js中的getNative()方法:this.document.getWindow().$.getSelection()报了getSelection() undefined的错误。出现了问题,开始一直百度谷歌。在此罗列一下,众网友给出的答案:
1、getSelection()方法的浏览器兼容性。我的浏览器版本是Chrome 53.0.2785.116 (64-bit),应该不是浏览器兼容问题吧。。
2、ckeditor在tab页面中的引用,存在bug。这个问题是翻译自stackoverflow一位网友的回答。
3、也有说是ckeditor语言包的原因,下载包的时候,选自定义的版本,选泽中文版。没有力气去试,后来直接换掉了
4、我自己归纳的:extjs2的tab页是一个Iframe,Iframe中引用ckeditor。this.document.getWindow()拿到的window对象是窗体TOP的window对象。出于不知名的原因,该对象没有getSelection()这个方法的定义。我尝试将editor.js中的this.document.getWindow().$.getSelection()换成window.selection,报错是木有了,但是编辑器排版乱了。
最后,实在是搞不明白,搞不定。就将ckeditor换成了百度的ueditor。完美解决,插件开发也一样容易。
阅读全文
0 0
- ckeditor4.6.2在extjs2的tab页,报错this.document.getWindow().$.getSelection() undefined
- document.selection 和getSelection 的demo
- document.getSelection,document.selection.createRange
- document.getSelection,document.selection.createRange
- 在TabNavigator中使用Navigation报错undefined is not an object (this.props.navigation.navigate)
- 网页中获取当前选取的内容 document.getSelection,document.selection.createRange
- this.options在chrome浏览器提示undefined的解决办法
- Extjs grid报this.config[] is undefined
- getSelection和range的笔记
- Python 在 Eclipse报错 Undefined variable from import: setdefaultencoding
- JS function document.onclick(){}报错Syntax error on token "function", delete this token
- JS function document.onclick(){}报错Syntax error on token "function", delete this token
- document.selection和window.getSelection属性和方法详解
- 屏幕取词: window.getSelection和document.selection
- this.onMetaChange is undefined和Ext.Container.LAYOUTS[this.layout.toLowerCase()] is not a constructor报错
- getWindow()
- ckeditor4.5.11+ckfinder_java2.6.2配置
- Xcode报错undefined xxx
- 在IAR新建CC3200工程所需配置项
- 数据库事务隔离级别和锁实现机制
- nginx 指令
- 自定义提示框
- 瞎杰瑞写
- ckeditor4.6.2在extjs2的tab页,报错this.document.getWindow().$.getSelection() undefined
- sql之left join、right join、inner join的区别
- windows网络编程(八)——重叠I/O+多线程实现简单的聊天(windows服务器端 windows客户端)
- 安卓开发-高仿ios时间选择控件timepicker
- 新手设计师可以借鉴的10条经验
- 入门篇:函数计算的基本概念和通用场景概述
- caffe学习笔记13:初识数据可视化
- 35 红外接收头在linux内核里的驱动
- ntp服务器配置