簡體   English   中英

TinyMCE(富文本編輯器lib)的Textarea不顯示任何內容

[英]Textarea of TinyMCE(Rich text editor lib) doesn't show anything

我很困惑我對使用TinyMCE的看法。 首先,我從http://www.tinymce.com/download/download.php下載它,然后選擇TinyMCE 4.0.3。 完成下載后,我有一個文件夾tinymce_4.0.3,該文件夾具有tinymce_4.0.3 \\ tinymce \\ js \\ tinymce之類的文件夾,然后將此文件夾(js / tinymce)復制到我的網站中的文件夾mywebsite中。

最后,我用這樣的代碼創建test.php文件(我從http://www.tinymce.com/tryit/full.php編寫了代碼)

<html>
<head>
<script type="text/javascript" src="js/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
    selector: "textarea",
    theme: "modern",
    plugins: [
        "advlist autolink lists link image charmap print preview hr anchor pagebreak",
        "searchreplace wordcount visualblocks visualchars code fullscreen",
        "insertdatetime media nonbreaking save table contextmenu directionality",
        "emoticons template paste textcolor moxiemanager"
    ],
    toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
    toolbar2: "print preview media | forecolor backcolor emoticons",
    image_advtab: true,
    templates: [
        {title: 'Test template 1', content: 'Test 1'},
        {title: 'Test template 2', content: 'Test 2'}
    ]
});
</script>
</head>
<body>
<form method="post" action="somepage">
    <textarea name="content" style="width:100%"></textarea>
</form>
</body>
</html>

但是,當我打開url localhost / mysite / test.php時,沒有任何顯示。 有人知道我怎么了嗎?

非常感謝。

哦,我發現問題是因為缺少插件。 在TinyMCE網站上的以下代碼中,最后一個插件moxiemanager沒有免費下載,這就是為什么上面的代碼無法顯示任何內容的原因。

plugins: [
    "advlist autolink lists link image charmap print preview hr anchor pagebreak",
    "searchreplace wordcount visualblocks visualchars code fullscreen",
    "insertdatetime media nonbreaking save table contextmenu directionality",
    "emoticons template paste textcolor moxiemanager"
],

解決問題只是刪除moxiemanager。

感謝大家。

暫無
暫無

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

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