好吧,所以我有一個完整的ajax系統每個頁面加載處理,雖然ajax它的很多凌亂的代碼在這一刻,所以我不會告訴你。TinyMCE jQuery ajax從保存後不顯示
我遇到的問題是,當我到我的內容加載TinyMCE它完美的工作,一次,然後一旦表單提交它使用TinyMCE元素remove()
然後一旦它完成它從內容服務器,然後有一個TinyMCE textarea和它加載奇怪的東西是內容不顯示,但如果我點擊HTML按鈕的內容是在TinyMCE textarea內。
我會盡量表現出更好的說明了一下使用盡可能少的代碼爲更多鈔票
所以這個每次conent從服務器
$(".addonContent form textarea.tinyMCE").tinymce({
// Location of TinyMCE script
script_url : '/script/tiny_mce/tiny_mce.js',
// General options
theme : "advanced",
plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
// Theme options
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pasteword,|,bullist,numlist,|,blockquote,|,undo,redo,|,link,unlink,anchor,image,code,",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,charmap,emotions,media,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "/style/style_content.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
重新加載時間是TinyMCE的呼叫,這個完美的作品第一次
現在我給ajaxForm代碼的運行,並將其提交數據到服務器之前調用
$(".addonContent form textarea.tinyMCE").tinymce().remove()
但隨後當內容回來,微小的MCE負荷不會顯示在編輯器中的內容,但如果我點擊HTML按鈕,內容顯示
編輯 這似乎與TinyMCE的一個bug和谷歌瀏覽器作爲下面的代碼與IE8 +的作品,並與Firefox的作品,我現在嘗試CKeditor。
+1好問題描述 – Thariama 2012-03-06 09:39:08