无法加载从数据库中的文本微小的MCE编辑器中

问题描述 投票:0回答:2

我用我的网站的小MCE编辑器,我想加载从数据库中使用TinyMCE的文本区域一些文本。

为编辑器中的JavaScript配置如下:

<script type="text/javascript">
tinyMCE.init({
    mode : "textareas",
    theme : "advanced",
    editor_selector : "mceAdvanced",
    plugins : "style,table,iespell,preview,directionality,inlinepopups",

    // Theme options
    theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontsizeselect",
    theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,link,unlink,image,code,|,forecolor",
    theme_advanced_buttons3 : "tablecontrols",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",

    // Example content CSS (should be your site CSS)
    content_css : "css/example.css",

    // Drop lists for link/image/media/template dialogs
    template_external_list_url : "js/template_list.js",
    external_link_list_url : "js/link_list.js",
    external_image_list_url : "js/image_list.js",
    media_external_list_url : "js/media_list.js",

    // Replace values for the template plugin
    template_replace_values : {
        username : "Some User",
        staffid : "991234"
    }
});
</script>

这就是我想要的文字载入里面textarea的方式:

<textarea name="program" cols="40" rows="12" class="contact_fields mceAdvanced"><? php echo $row_this_trip['program']; ?></textarea>

还没有下面的工作是:

<textarea name="program" cols="40" rows="12" class="contact_fields mceAdvanced">Lorem Ipsum</textarea>

要么

<textarea name="program" cols="40" rows="12" class="contact_fields mceAdvanced"><?php echo( htmlentities( $row_this_trip['program'] ) ); ?></textarea>

我找不到什么是错在这。你能帮我么?

php database tinymce echo
2个回答
1
投票

你有没有在你的HTML的TinyMCE的脚本链接?

<script src="linktoscript.js" type="text/javascript" />

-1
投票

tinyMCEtriggerSave事件。

tinymce.triggerSave(); 

例如,

tinymce.triggerSave();

$.ajax({
        type: 'post',
        url: 'autoSaveReport.php',
        data: $('form').serialize(),
        success: function (result) {
          var redirectURL = window.location.pathname;
          var redirectURL1 = redirectURL+"?incid="+result;
            window.location = window.location+"?incid="+result;
         }
      });
© www.soinside.com 2019 - 2024. All rights reserved.