百度ueditor组件上传图片后<img>里的alt设置
来源:互联网 发布:python if statement 编辑:程序博客网 时间:2024/05/16 01:41
百度ueditor组件,使用上传图片后,自动将上传图片显示在编辑器中,也就是插入了一个<img>标签。并设置了一个alt属性,其值是上传图片时的本地路径。暂时没发现哪里可以配置这个值。在查看发布的内容时,看到alt的值是一个磁盘路径,有点别扭。
可以在编辑完内容,保存到数据库时过滤下,修改alt的内容,也可以直接修改源码
function callback(){
try{
var link, json, loader,
body = (iframe.contentDocument || iframe.contentWindow.document).body,
result = body.innerText || body.textContent || '';
json = (new Function("return " + result))();
link = me.options.imageUrlPrefix + json.url;
if(json.state == 'SUCCESS' && json.url) {
loader = me.document.getElementById(loadingId);
loader.setAttribute('src', link);
loader.setAttribute('_src', link);
loader.setAttribute('title', json.title || '');
loader.setAttribute('alt', json.original || '');
loader.removeAttribute('id');
domUtils.removeClasses(loader, 'loadingclass');
} else {
showErrorLoader && showErrorLoader(json.state);
}
}catch(er){
showErrorLoader && showErrorLoader(me.getLang('simpleupload.loadError'));
}
form.reset();
domUtils.un(iframe, 'load', callback);
}
- 百度ueditor组件上传图片后<img>里的alt设置
- 百度ueditor组件上传图片后如何设置img标签里的src、title、alt等属性
- 百度ueditor上传图片时设置默认宽高度
- 百度ueditor踩坑,ueditor图片上传
- 百度UEditor上传图片配置
- 如何调用百度编辑器ueditor的上传图片、上传文件
- UEditor 图片上传路径设置
- 百度UEditor里面截取出来的图片上传功能
- 百度编辑器ueditor给上传的图片添加水印
- 20150129 百度Ueditor 上传本地图片失败的处理
- 百度编辑器ueditor修改文件图片上传路径的方法
- 百度Ueditor在线编辑器的配置和图片上传
- 百度ueditor图片上传不能正确显示的问题
- 百度ueditor图片上传不能正确显示的问题
- 百度UEditor调用单图片上传功能的解决方法
- 百度Ueditor设置允许上传的图片格式及大小
- 百度富文本控件UEditor 上传图片
- 百度Ueditor多图片上传控件
- iOS 7系列译文:认识 TextKit
- [LeetCode] Reverse Linked List II
- 八皇后问题
- 在vs2010下使用C#连接Oracle数据库
- ios开发(三)
- 百度ueditor组件上传图片后<img>里的alt设置
- 关于Class
- Codeforces Round #263 (Div. 2)A. Appleman and Easy Task
- Map查找表
- 【Android】 自定义ViewGroup 实战篇 -> 实现FlowLayout
- android ImageView关于网络加载图片圆形处理
- jQuery+JavaScript+PHP 制作简单的文本框输入自动提示
- VS2012+mysql
- Codeforces Round #263 (Div. 2)B. Appleman and Card Game