0
私はiBookのiframeにTinyMCEエディタを作成し、iframeの外側にボタンがあります。私の問題は、ボタンクリックでエディタの値を取得するtaht iwantですが、私は何も見つからなかっボタンをクリックしたときに、ここで助けてください私のコードTiny MCE Editor in iframe
のiframeコード:
<iframe id="EditorFrame" src="UploadTemplates.aspx" frameborder="0" style="height: 900px;
width: 1000px" scrolling="auto"></iframe>
UploadTemplates.aspxコード:
<div>
<p>
<textarea id="TemplateEditor" cols="50" rows="50" runat="server">
</textarea>
</p>
</div>
のjQueryコード:Button1の中興jqueryの私のクリックで
$(function() {
uploader = $("#TempateFileUploader");
tinyMCE.init({
// General options
mode: "textareas",
theme: "advanced",
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_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_statusbar_location: "bottom",
theme_advanced_resizing: false,
width: "800",
height: "640"
// setup: function (ed) {
// ed.onClick.add(function (ed, e) {
// alert('Editor was clicked: ' + e.target.nodeName);
// });
// }
});
$("#Button1").click(function() {
alert(tinymce().get("TemplateEditor").getCOntent());
});
});
私はTinyMCEをのオブジェクトが見つかりましたが値を取得することはできませんTinyMCEのをalthougの何も見つからなかったあなたの問題を解決するには、getContent()
を使用するのが良いかもしれないjqueryの
私もgetContent()を使用しますが、値は未定義です –
tinymce()の代わりにtinymce.get( "TemplateEditor")を使用してくださいget( "TemplateEditor")! – Thariama