Ueditor上传注意事项

ueditor.all.js的配置可以让视频在编辑器中能够播放,但是提交到数据库的时候会存在一些问题,即内容仅为视频时ue.getContent()获取到的编辑器中的内容为空,只有当输入其他字符时,ue.getContent()才能获取到编辑器中的内容。因此不推荐修改下面ueditor.all.js中的内容。

ueditor.all.js

7343,7344,7345三行注释掉

// var root = UE.htmlparser(html);

           // me.filterInputRule(root);

           // html = root.toHtml();

17769行  image改成video

// html.push(creatInsertStr( vi.url, vi.width || 420,  vi.height || 280, id + i, null, cl, 'image'));

               html.push(creatInsertStr( vi.url, vi.width || 420,  vi.height || 280, id + i, null, cl, 'video'));

其实出现上传视频后在编辑器中一片空白的情况,查看HTML源码src丢失,可将

ueditor.config.js  第365行  whitList修改为whiteList

修改后编辑器中上传视频的效果



这样改了之后,编辑器中的视频内容是可以通过ue.getContent()获取到的。


上一篇: JavaScript生成树形菜单(递归算法) 下一篇: 没有下一篇了
1624 2020-09-17

JavaScript >>

Linux >>

PHP >>

HTML/CSS >>

C/C++ >>

MySql >>

常用工具使用 >>