3
我正在使用Javascript函數來獲取託管在我的服務器上的HTML文件的內容,然後將內容添加到TinyMCE編輯器。TinyMCE從我的HTML代碼中刪除CSS
這是功能:
function LoadTemplate(url) {
$.post(url, function (data) {
// Get the editor instance that we want to interact with.
var ed = tinyMCE.get('html_editor');
;
// Insert the response into TinyMCE editor
ed.setContent(data, {format : 'raw'});
// Hide The Templates Div
HideTemplates();
}, "text");
}
選擇一個文件的用戶後,點擊加載模板,HTML文件插入到沒有任何問題TinyMCE的編輯器,但點擊提交後,我的發現數據庫頭文件,以及由TinyMCE刪除的樣式標籤中的CSS。
我加入TinyMCE的常規選項:
element_format : "html",
verify_html : false,
,但我仍然得到同樣的錯誤
謝謝您的回答,現在的編輯器不刪除標題和正文,但仍刪除頁眉任何CSS代碼。有沒有解決方案? – Hamza 2012-02-16 22:53:43
@McShark閱讀本文http://stackoverflow.com/questions/3037501/tinymce-is-removing-style-tags – Cheery 2012-02-16 23:00:42
謝謝你的解決方案,你節省了我的一天 – Hamza 2012-02-16 23:33:29