手机
当前位置:查字典教程网 >编程开发 >网页编辑器 >UEditor 编辑器跨域上传解决方法
UEditor 编辑器跨域上传解决方法
摘要:解决的方法:1.在ueditordialogsinternal.js加入document.domain='根域名';2.在当前页面同样指定根...

解决的方法:

1.在 ueditordialogsinternal.js 加入 document.domain = '根域名';

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

复制代码 代码如下:

<script type="text/javascript">

document.domain = "根域名";

</script>

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

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

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

复制代码 代码如下:

if (ie) {

document.getElementById('baidu_editor_' + this.uid).src = "javascript:(function(){document.open();document.domain='"+document.domain+"';document.close();})()";

}

接下来找到:

me.document = doc;

在它下边加入:

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

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

作者:东奎

【UEditor 编辑器跨域上传解决方法】相关文章:

ASP FCKeditor在线编辑器使用方法

Ewebeditor 文件上传问题

ASp.net下fckeditor配置图片上传最简单的方法

KindEditor 编辑器 v3.5.1 修改版

jsp fckeditor 上传中文图片乱码问题的解决方法

FCKeditor 2.6 编码错误导致修改的内容出现乱码的解决方法

Html 编辑器粘贴内容过滤技术详解

eWebEditor 请选择一个有效的文件的解决方法

FCKeditor添加自定义按钮的方法

eWebEditor 辑器按钮失效 IE8下eWebEditor编辑器无法使用的解决方法

精品推荐
分类导航