簡體   English   中英

設置功能在TinyMCE中不起作用

[英]Setup Function not working in TinyMCE

當我嘗試在TinyMCE javascript中添加Setup:函數時,將其Richtextbox轉換為簡單的textarea。

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>

<script type="text/javascript" src="//tinymce.cachefly.net/4.0/tinymce.min.js"></script>
<script type="text/javascript" >
tinyMCE.init({
    selector: 'textArea',  // change this value according to your HTML
    menu: {
        edit: { title: 'Edit', items: 'undo redo | cut copy paste pastetext | selectall' },
        insert: { title: 'Insert', items: 'link media | template hr' },
        format: { title: 'Format', items: 'bold italic superscript subscript' },
        tools: { title: 'Tools', items: 'spellchecker code' }
    },
    resize: 'both',
    plugins: "wordcount",
    encoding: "xml",
    setup: function (ed) {
        ed.onSaveContent.add(function (ed, o) {
            o.content = o.content.replace(/&#39/g, "&apos");
        });
    }
});
 </script>
</head>
<body>
 <form id="form1" runat="server">
 <div>
    <textarea id="content1" rows="2" cols="20" runat="server" ></textarea>
    <textarea id="content2" rows="2" cols="20" runat="server" ></textarea>
    <textarea id="content3" rows="2" cols="20" runat="server" ></textarea>
    <asp:Button ID="btnSave" Text="Save" runat="server"  OnClick="btnSave_Click"></asp:Button>

</div>
</form>

我不知道這是什么問題,因為如果沒有Setup:功能,它的工作絕對正常。

setup: function (editor) {
             editor.on('SaveContent', function (e) {
                 e.content = e.content.replace(/&#39/g, "&apos");
             });
         }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM