2011-10-10 113 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內容,然後將其發送到將處理數據的文件!