I implemented 4 TinyMCE editors on one page. I want to get the editor ID when the user leaves the TinyMCE editor and put the editor's html in the textarea. On blur I can get the editor html. but I can't find the iFrame ID in Firefox and IE. I tried this code.
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "table,insertdatetime,fullscreen,searchreplace,emotions,paste,",
selector: "#vereinbarungen",
selector: "#narration",
theme_advanced_buttons1 : "insertdate,inserttime,|,hr,emotions,|,search,replace,|,cut,copy,paste,pastetext,pasteword,|,forecolor,backcolor,|,bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,|,fullscreen",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "bottom",
theme_advanced_toolbar_align : "left",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
plugin_insertdate_dateFormat : "%d.%m.%Y",
plugin_insertdate_timeFormat : "%H:%M:%S",
setup : function(ed) {
ed.onInit.add(function(ed, event) {
var dom = ed.dom,
doc = ed.getDoc(),
el = doc.content_editable ? ed.getBody() : (tinymce.isGecko ? doc : ed.getWin());
tinymce.dom.Event.add(el, 'blur', function(e) {
//this is the targeted iframe id this works in chrome but not works in other browsers.
target_id = el.frameElement.id;
html = $(ed.getBody()).html();
});
});
},
});
When I tried this code with Chrome I get the target_id
but when I try with other browsers el.frameElement
is undefined.
What is the solution to this problem?