TinyMCE not working - even with their example?

社会主义新天地 提交于 2019-12-10 15:50:38

问题


ISSUE:

I am attempting to use TinyMCE 4.0.12. But couldn't get it to work, it just makes my text areas disappear altogether.

What i have done so far:

I even copied their example code exactly from their page, and it doesn't even work with that.

I have extracted all of the files to "js/tinymce/"

Is there something obvious I am missing?

Fiddle: http://jsfiddle.net/cg3e8/

JS CODE:

<script type="text/javascript" src="js/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
    selector: "textarea",
    plugins: [
        "advlist autolink lists link image charmap print preview anchor",
        "searchreplace visualblocks code fullscreen",
        "insertdatetime media table contextmenu paste moxiemanager"
    ],
    toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
});
</script>

HTML CODE:

    <form method="post" action="somepage">
       <textarea name="content" style="width:100%"></textarea>
    </form>

回答1:


I tried your fiddle and I removed moxiemanager plugin, and It worked

<script type="text/javascript" src="js/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
    selector: "textarea",
plugins: [
    "advlist autolink lists link image charmap print preview anchor",
    "searchreplace visualblocks code fullscreen",
    "insertdatetime media table contextmenu paste "
],
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter      alignright alignjustify | bullist numlist outdent indent | link image"
});
</script>

<form method="post" action="somepage">
    <textarea name="content" style="width:100%"></textarea>
</form>

http://jsfiddle.net/cg3e8/1/

Looking on the google for it I discovered this question that It probably solves the issue

TinyMCE moxiemanager




回答2:


If you wish to use any local plugins (like MoxieManager for example) you need to load them using the new external_plugins option.




回答3:


<script src="https://cloud.tinymce.com/stable/tinymce.min.js"></script>

Replace this <script type="text/javascript" src="js/tinymce/tinymce.min.js"></script> part of your code with the code above.

I hope it works !



来源:https://stackoverflow.com/questions/20856547/tinymce-not-working-even-with-their-example

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!