簡體   English   中英

帶有div標簽的TinyMCE?

[英]TinyMCE with div tag?

以下是我的JSP代碼:

<tr>
      <td colspan="2">custEmail</td>
      <td colspan="5"><div id= "custEmail"><p><strong>Test</strong></p></div></td>
</tr>

下面是安裝的代碼divTinyMCE的編輯器

<script type="text/javascript" src="tinymce/tinymce.min.js"></script>
<script type="text/javascript">
tinyMCE.init({
        width : "640",
        mode : "exact",
        elements : "custEmail",
        theme : "advanced",
        plugins : "preview",
        readonly : true,
        theme_advanced_buttons1 : "forecolor,backcolor,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,formatselect,fontselect,fontsizeselect,sub,sup,|,bold,italic,underline,strikethrough",
        theme_advanced_buttons2 : "",
        theme_advanced_buttons3 : "",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true
    });
</script>

但是在我的HTML頁面上,我看到的內容為:

<p><strong>Test</strong></p>

而不是大膽的測試。 一旦我更改以下內容:

div id="custEmail" tag to textarea id="custEmail"

工作正常。 不確定是否需要對div標簽進行一些設置?

您需要做的就是將forced_root_block設置為'div'

tinyMCE.init({
        ...
        forced_root_block : 'div'
});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM