我在使用带有 grails 的“tiny-mce”时遇到问题(textarea 显示不正确)。我正在使用 Eclipse Indigo,并使用“grails install-plugin tiny-mce”安装了 tiny-mce 插件。我写的代码是:
<!doctype html>
<html>
<head><title>TinyMCE Test</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<tinyMce:resources />
<tinyMce:importJs/>
</head>
<body>
<tinyMce:renderEditor type="advanced"/>
</body>
</html>
问题是显示的textarea 没有tiny-mce 功能,即所有可用于格式化文本的漂亮属性/按钮。textarea 只是一个简单的 html textarea。看起来检查生成的源代码(即右键单击->查看源代码)可能有一些问题:
<!doctype html>
<html>
<head><title>TinyMCE Test</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="/MyGrailsProject/static/plugins/tiny-mce- 3.4.9/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="/MyGrailsProject/static/plugins/tiny-mce-3.4.9/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script><script type="text/javascript">tinyMCE.init({
mode : "textareas",
theme : "simple",
editor_selector : "mcesimple",
theme_advanced_toolbar_location : "null"
});tinyMCE.init({
mode : "textareas",
theme : "advanced",
editor_selector : "mceadvanced",
theme_advanced_toolbar_location : "top"
});</script>
</head>
<body>
<textarea class='null mceadvanced'></textarea>
</body></html>
看起来 textarea 类有一个空值。这个对吗?有谁知道为什么我的 textarea 渲染不正确?问题是否与找不到文件“tiny_mce.js”有关?如果是这种情况,我该如何解决这个问题?
最好的问候克莱