2012-03-17 46 views
0

我有一个HTML网页,我在iframe中起诉TinyMCE编辑器,我有一个按钮,这是在iframe外侧。我的问题是taht iwant获得上按一下按钮编辑器的值,但是当我点击按钮,我什么也没找到,请帮助这里是我的代码微小的MCE编辑器在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代码:

$(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()); 
    }); 

}); 

上Button1的兴jQuery的我的点击没有发现TinyMCE althoug我发现tinyMCE的对象,但无法获得价值,请帮助我如何获得timyMCE的外侧iframe上的按钮点击使用jquery

回答

0

您的问题的解决方案可能是getContent()而不是getCOntent()。 使用getCOntent()你应该得到javascript错误!

+0

我也使用getContent()但值不确定 – 2012-03-19 14:43:46

+0

使用tinymce.get(“TemplateEditor”)而不是tinymce()。get(“TemplateEditor”)! – Thariama 2012-03-20 08:31:26