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 跨域傳圖片的問題,希望對大家有所幫助。
作者:東奎
相關文章
Fckeditor編輯器內(nèi)容長度限制統(tǒng)計實現(xiàn)方法
Fckeditor是一種大家常用的編輯器,但是他不能像網(wǎng)頁表單那樣利用document.getelementbyid能獲取得到值了,它必須通過 FCKeditorAPI來操作,下面看看Fckeditor內(nèi)容長度測試2012-03-03使用Js獲取、插入和更改FCKeditor編輯器里的內(nèi)容
這篇文章主要介紹了使用Js獲取、插入和更改FCKeditor編輯器里的內(nèi)容,包括JS操作Fckeditor的一些常用方法,需要的朋友可以參考下2020-02-02ajax php實現(xiàn)給fckeditor文本編輯器增加圖片刪除功能
工作需要需要fck編輯器的服務器瀏覽加個圖片刪除的功能,我們利用ajax php實現(xiàn)的有需要的朋友可以參考下2012-12-12