我有一个带文本框的页面。我试图添加一个tinyMCE编辑器,但是当我加载页面时它没有显示。 这是我正在使用的代码:
<script type="text/javascript" src="../static/js/tiny_mce/tiny_mce.js" ></script>
<script type="text/javascript">
tinyMCE.init({
mode : "exact",
elements : "page_content",
theme : "advanced",
auto_focus : "page_content",
plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
});
</script>
<form method="POST">
Title: <input type="text" value="" name="title" style="width:460px;"><br />
Content: <textarea id="page_content" name="content"></textarea><br />
<input type="submit" name="save" value="Save"><a href="?id=">cancel</a>
</form>
我在网站上有第二个表单,tinyMCE工作正常。这是可以的代码:
<script type="text/javascript" src="../static/js/tiny_mce/tiny_mce.js" ></script >
<script type="text/javascript">
tinyMCE.init({
mode : "exact",
elements : "quote",
theme : "advanced",
auto_focus : "quote",
plugins: "emotions",
theme_advanced_buttons1 : "bold, italic, emotions, forecolor",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
width:500,
});
</script>
<input type="text" name="quote" value="{% if profile.id %}{{ profile.quote }}{% else %}{{ post.quote }}{% endif %}" />
第一段代码出了什么问题?