UEditor 编辑器跨域上传解决方法(ueditor serverurl)奔走相告

随心笔谈11个月前发布 admin
110 0



解决的方法:

1.在 ueditor\dialogs\internal.js 加入 document.domain=’根域名’;

2.在当前页面同样指定根域名:

复制代码 代码如下:

    document.domain=”根域名”;

这样在 chrome、firefox 下没有问题,但在 ie 下还需要简单修改下 UEditor,在 editor.js 中找到:

this._setup( container.firstChild.contentWindow.document );

在它上边加入下边的代码:

复制代码 代码如下:

if (ie) {

    document.getElementById(‘baidu_editor_’ + this.uid).src=”https://www.jb51.net/article/javascript:(function(){document.open();document.domain='”+document.domain+”‘;document.close();})()”;

}

接下来找到:

me.document=doc;

在它下边加入:

me.document.domain=’根域名’;

到这里就解决了 UEditor 跨域传图片的问题,希望对大家有所帮助。

作者:东奎 

您可能感兴趣的文章:.NET UEditor使用方法说明.NET下为百度文本编辑器UEditor增加图片删除功能示例ASP.NET中集成百度编辑器UEditor如何在.Net版本UEditor中添加一个普通按钮利用ASP.NET MVC+Bootstrap搭建个人博客之修复UEditor编辑时Bug(四)免费开源百度编辑器(UEditor)使用方法UEditor编辑器自定义上传图片或文件路径的修改方法关于UEditor编辑器远程图片上传失败的解决办法百度ueditor组件上传图片后如何设置img里的alt属性一步步教你在Asp.net Mvc中使用UEditor编辑器

© 版权声明

相关文章