Ich habe initialisiert tinyMCE wie so:vollständig entfernen JQuery tinyMCE
$('#text').tinymce({
// Location of TinyMCE script, optional, already loaded in page.
script_url : '../adminContent/js/tiny_mce/tiny_mce.js',
// General options
theme : "advanced",
plugins : "table,advimage,advlink,iespell,inlinepopups,preview,contextmenu,paste,visualchars",
// Theme options
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,forecolor,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,removeformat,cleanup,code,|,preview,tablecontrols,|,hr,visualaid,|,charmap,iespell",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true
});
Der obige Code funktioniert perfekt. Das Problem ist, wenn ich versuche, tinyMCE zu entfernen.
Mein entfernen Code ist:
$('#text').tinymce().execCommand('mceRemoveControl', false, 'text');
ich auch versucht habe:
$('#text').remove();
und
$('#text').tinymce().remove();
Die erste nichts zu tun scheint. Die letzten beiden geben Sie mir diesen Fehler:
Uncaught ReferenceError: t is not defined
Obwohl tinymce durch das HTML-Dokument geladen wird, ich bin Laden ein anderes Skript:
$.getScript(viewPath + '/mod/adminContent/js/editContent.js', function(){
initEditContent(popup);
});
Popup ein Verweis auf das Popup, in dem tinymce geladen ist . Es ist einfach ein Div, das mit jQuery erstellt wird. Der Inhalt des Div wird mit jquery ajax geladen.
Die editContent.js sieht wie folgt aus:
var contentID;
function initEditContent(popup){
contentID = $('#contentID').val();
tinyMCE.execCommand("mceAddControl", true, 'text');
setTimeout(reposition, 50);
setTimeout(reposition, 150);
setTimeout(reposition, 250);
// Submit form
$('#editTextForm').ajaxForm(
{
// Before submit
beforeSubmit: function(){
//setPopupMessage(popup, '<div id="loading"><img src="../../img/loading.gif" /> Please wait...</div>');
},
// Once submit completed
success: function(responseText){
tinyMCE.execCommand("mceRemoveControl", true, 'text');
//closePopup(popup);
// Update button with new data
$('#' + contentID).html(responseText);
}
});
}
'.tinymce() entfernen()' sollte es tun.. Können Sie einen Testfall auf [jsFiddle] (http://jsfiddle.net) veröffentlichen, wo Ihr Problem reproduziert wird? – mekwall
Ich habe meine erste Frage bearbeitet, um Ihnen weitere Details zu geben. Ich kann jsFiddle nicht benutzen, weil es zu viele externe Teile benötigt. – JPardoe
genannt tinyMCE.remove(); und es gab einen Fehler: "Uncaught TypeError: Kann die Eigenschaft 'id' von undefined nicht lesen" in Zeile 11264 von tiny_mce_src.js – JPardoe