0

我很困惑我如何错误地使用 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 中。

Atlast 我用这样的代码创建 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 时什么都没有显示。有谁知道我出现了什么问题?

非常感谢。

4

1 回答 1

0

哦,我发现问题是因为缺少插件。以下来自 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。

感谢大家。

于 2013-08-13T06:14:27.287 回答