您好,欢迎访问一九零五行业门户网

UEditor 编辑器跨域上传解决方法

解决的方法:
1.在 ueditor\dialogs\internal.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 编辑器跨域上传解决方法。
其它类似信息

推荐信息