1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

tinyMCE editor question

Discussion in 'XenForo Development Discussions' started by makdeniss, Dec 15, 2010.

  1. makdeniss

    makdeniss Active Member

    Hi,

    This code line gives me not only the text I've typed in the editor:
    Code:
    var x= tinyMCE.activeEditor.getContent();
    but also this kind of HTML code within it:
    Code:
    <p>MYINPUT_EDITOR_TEXT<br _mce_bogus="1"></p>
    My question would be: how to get read the EDITOR without the formatting?
     
  2. Shadab

    Shadab Well-Known Member

    This works for me:

    Code:
    var editor = tinyMCE.activeEditor;
    editor.selection.select(editor.dom.getRoot());
    var content = editor.selection.getContent({format : 'text'});
    editor.selection.collapse();
    
    alert(content);
    Reference: http://tinymce.moxiecode.com/punbb/viewtopic.php?id=14446
     
    makdeniss likes this.
  3. makdeniss

    makdeniss Active Member

    Thanks!!!!!!!!! That really works!!!!! Now, the biggest questions is how to save the formatting during extraction and insertion? :)
     

Share This Page