我对 javasrcipt 几乎一无所知,但我知道我应该能够做到这一点。
我想进行几个不同的 tinymce.init 调用。如果我将它们加载到页面的头部,它们可以正常工作,但如果我将它们移动到外部 .js 文件,它们就不行了。有人可以告诉我以下有什么问题吗?
我的页面文件头:
<head id="Head1" runat="server">
<title></title>
<script type="text/javascript" src="../Scripts/tiny_mce/tiny_mce_src.js"></script>
<script type="text/javascript" src="../Scripts/load_tinymce.js"></script>
</head>
还有我的外部文件(load_tinymce.js):
tinyMCE.init({
mode: "specific_textareas",
editor_selector: "StandardEditBox",
theme: "advanced",
theme_advanced_buttons1: "bold,italic,underline,|,sub,sup,charmap",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_statusbar_location: "none",
forced_root_block: false,
height: "50",
encode: "xml",
theme_advanced_resizing: false,
setup: function (ed) {
ed.onSaveContent.add(function (i, o) {
o.content = o.content.replace(/'/g, "&apos");
});
}
});
tinyMCE.init({
mode: "specific_textareas",
editor_selector: "CommentsTextBox",
theme: "advanced",
theme_advanced_buttons1: "bold,italic,underline,|,sub,sup,charmap",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_statusbar_location: "none",
forced_root_block: false,
height: "150",
width: "580",
encode: "xml",
theme_advanced_resizing: false,
setup: function (ed) {
ed.onSaveContent.add(function (i, o) {"&apos");
});
}
});
我觉得我的 .js 文件中应该还有其他内容,但我不知道它可能是什么。