TinyMce 模板

TinyMce templates

使用 Tinymce 模板插件。我无法加载模板。当插件被称为模板的标题时,它会出现,但没有加载任何其他内容,当我单击“确定”时,弹出窗口消失但没有加载模板。模板的文件路径是正确的,所以我不明白为什么正在加载。 代码:

<!DOCTYPE html>
<html>
<head>
    <script type="text/javascript" src="tinymce/tinymce.min.js"></script>
    <script type="text/javascript">
        tinymce.init({
            selector: "#messaging",
            width: "700px",
            height: "300px",
            resize: false,
            toolbar: "template | undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent",

            plugins: "template",            
            templates: [
                {title: 'Signature', description: 'Insert and edit your signature', url: 'tinymce/templates/signature.html'}            
            ]

        });

    </script>
</head>
<body>

    <form method="post">
        <textarea id="messaging"></textarea>
    </form>
</body>
</html>

例如基本模板:

<div class="mceTmpl">
    <p>content</p>
</div>

如有任何帮助,我们将不胜感激。

编辑:在 Firefox 中工作正常,所以我假设这是 Chrome,ps 这都是本地 运行。

试试这个设置:

@Scripts.Render("~/Content/Scripts/js/jquery-1.8.0.min.js")     // May required        
@Scripts.Render("~/Content/Scripts/tinymce/tinymce.min.js")           
        <script>
            tinymce.init({
                selector: 'textarea#messaging',
                height: 375,
                menubar: true,
                resize: true,
                toolbar_items_size: 'small',
                toolbar: "undo redo | styleselect bold italic forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | fontselect fontsizeselect lineheight | link print preview fullpage ",
                plugins: [
                    "advlist autolink link lists charmap print preview hr anchor pagebreak spellchecker",
                    "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime nonbreaking",
                    "save table contextmenu directionality paste textcolor lineheight"
                ]
            });
        </script>

并确保以正确的路径渲染它。