2011-10-10 131 views
3

我想实现tinyMCE的BBCode插件,但无法使其工作。 这是初始化代码:TinyMCE和BBCode插件

$(textarea).tinymce({ 
    script_url : '/js/tiny_mce/tiny_mce.js', 
    theme : "advanced", 
    plugins : "bbcode", 
    theme_advanced_buttons1 : "bold,italic,underline,forecolor,|,undo,redo,link,unlink,|,removeformat,cleanup", 
    theme_advanced_buttons2 : "", 
    theme_advanced_buttons3 : "", 
    theme_advanced_toolbar_location : "top", 
    theme_advanced_toolbar_align : "left", 
    theme_advanced_styles : "Code=codeStyle;Quote=quoteStyle", 
    entity_encoding : "raw", 
    remove_linebreaks : false, 
    forced_root_block : false, 
    force_br_newlines : true, 
    force_p_newlines : false,  
    convert_newlines_to_brs : true, 
    remove_redundant_brs : false, 
    width: '700px', 
    height: '250px' 
}); 

的事情是,当我提交表单,HTML标签被张贴,而不是BB代码。如果我在控制台上尝试tinyMCE.activeEditor.getContent(),它会带来BBCode。

我正在使用输入[type = submit]发送表单(没有附加任何JS)。

为什么我没有发布BBCode?

回答

0

尝试通过htmlentities函数传递textarea内容,然后将其发送到将处理数据的文件!