jquery,tinyMCE 2.1.3-从第二个实例获取内容
这就是我用php初始化网页中两个文本区域的tinyMCE插件的方法jquery,tinyMCE 2.1.3-从第二个实例获取内容,jquery,tinymce,Jquery,Tinymce,这就是我用php初始化网页中两个文本区域的tinyMCE插件的方法 tinyMCE.init({ mode : "textareas", theme : "advanced", //to add any new plugin add in this line plugins : "banglafkb,banglavkb,table,save,advhr,advimage,advlink,emotions,iespell,insert
tinyMCE.init({
mode : "textareas",
theme : "advanced",
//to add any new plugin add in this line
plugins : "banglafkb,banglavkb,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,media,searchreplace,print,contextmenu,paste,directionality,fullscreen",
theme_advanced_buttons1_add_before : "banglafkb,banglavkb",
//theme_advanced_buttons1_add : "banglafkb,banglavkb",
theme_advanced_buttons2_add : "fontselect, fontsizeselect ",
//theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",
//theme_advanced_buttons3_add_before : "tablecontrols,separator",
//theme_advanced_buttons3_add : "emotions,iespell,media,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
content_css : "example_word.css",
plugi2n_insertdate_dateFormat : "%Y-%m-%d",
plugi2n_insertdate_timeFormat : "%H:%M:%S",
external_link_list_url : "example_link_list.js",
external_image_list_url : "example_image_list.js",
media_external_list_url : "example_media_list.js",
file_browser_callback : "fileBrowserCallBack",
paste_use_dialog : false,
theme_advanced_resizing : true,
theme_advanced_resize_horizontal : false,
theme_advanced_link_targets : "_something=My somthing;_something2=My somthing2;_something3=My somthing3;",
paste_auto_cleanup_on_paste : true,
paste_convert_headers_to_strong : false,
paste_strip_class_attributes : "all",
paste_remove_spans : false,
paste_remove_styles : false,
force_p_newlines:false,
width:'700'
});
通过使用tinyMCE.getContent()
我获得了第一个编辑器实例的内容,但我也需要获得第二个编辑器实例的内容,我如何才能获得它
请注意,我使用2.1.3版本来使用仅为该版本开发的插件
进一步澄清:
上述版本已提供。这是这个版本的例子,它包含了为这个版本开发的插件,我需要使用这些插件。“选择键盘”下拉列表显示正在运行的插件。哦,我的。。。!这个小版本太旧了。较新的版本将在较新的浏览器上工作并处理问题,而这是旧版本所无法做到的。好吧,你想要的是可能的: 购买调用
tinyMCE.instances.mce\u editor\u 0.getHTML()
可以获得第一个编辑器instance的内容。要获取第二个编辑器实例的内容,可以使用
tinyMCE.instances.mce_editor_1.getHTML()
更新:看起来我得到了一个不使用jQuery的工作解决方案:
var instance = tinyMCE.get('mce_editor_1'); // get the editor instance
instance.select(); // select your editor instance
tinyMCE.getContent() // get the content
哦,我的。。。!这个小版本太旧了。较新的版本将在较新的浏览器上工作并处理问题,而这是旧版本所无法做到的。好吧,你想要的是可能的: 购买调用
tinyMCE.instances.mce\u editor\u 0.getHTML()
可以获得第一个编辑器instance的内容。要获取第二个编辑器实例的内容,可以使用
tinyMCE.instances.mce_editor_1.getHTML()
更新:看起来我得到了一个不使用jQuery的工作解决方案:
var instance = tinyMCE.get('mce_editor_1'); // get the editor instance
instance.select(); // select your editor instance
tinyMCE.getContent() // get the content
哦,太好了。。1) 但是你是从任何文档中还是通过查看插件本身得到的呢?2) 如果我在最新版本中使用banglafkb和banglavkb扩展,那么这是行不通的。在最新版本中使用它们真的很好。我在Window下摆弄浏览器javascript变量时发现了这一点。我找到了一些文档,但它们没有透露太多。您可以使用(在jQuery的帮助下)访问编辑器内容:$(tinyMCE._getElementById('mce_editor_0')).contents().find('body').html();你能把第二个编辑器添加到你的示例页面吗?事实上我是按照这个页面来的。这不是我开发的。你为什么需要第二个例子?如果你需要的话,我可以把它上传到我的服务器上。很高兴能帮上忙哦,太好了。。1) 但是你是从任何文档中还是通过查看插件本身得到的呢?2) 如果我在最新版本中使用banglafkb和banglavkb扩展,那么这是行不通的。在最新版本中使用它们真的很好。我在Window下摆弄浏览器javascript变量时发现了这一点。我找到了一些文档,但它们没有透露太多。您可以使用(在jQuery的帮助下)访问编辑器内容:$(tinyMCE._getElementById('mce_editor_0')).contents().find('body').html();你能把第二个编辑器添加到你的示例页面吗?事实上我是按照这个页面来的。这不是我开发的。你为什么需要第二个例子?如果你需要,我可以把它上传到我的服务器上。很高兴能帮上忙