javascript TinyMCE 不起作用 - 即使是他们的例子?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20856547/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
TinyMCE not working - even with their example?
提问by MRC
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.
我正在尝试使用 TinyMCE 4.0.12。但无法让它工作,它只会让我的文本区域完全消失。
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/"
我已将所有文件解压缩到“js/tinymce/”
Is there something obvious I am missing?
有什么明显的我遗漏了吗?
Fiddle:http://jsfiddle.net/cg3e8/
小提琴:http : //jsfiddle.net/cg3e8/
JS CODE:
JS代码:
<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:
HTML代码:
<form method="post" action="somepage">
<textarea name="content" style="width:100%"></textarea>
</form>
回答by Mattos
I tried your fiddle and I removed moxiemanager plugin, and It worked
我试过你的小提琴,我删除了 moxiemanager 插件,它奏效了
<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>
Looking on the google for it I discovered this question that It probably solves the issue
在谷歌上寻找它,我发现了这个问题,它可能解决了这个问题
回答by ankita kedia
If you wish to use any local plugins (like MoxieManager for example) you need to load them using the new external_plugins option.
如果您希望使用任何本地插件(例如 MoxieManager),您需要使用新的 external_plugins 选项加载它们。
回答by ash evan
<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.
用<script type="text/javascript" src="js/tinymce/tinymce.min.js"></script>
上面的代码替换这部分代码。
I hope it works !
我希望它有效!