Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the content of a Tinymce textarea with JavaScript

i have an array of content then how we get content of Tinymce textarea in javascript

like image 310
pooja Avatar asked Dec 29 '10 06:12

pooja


People also ask

How do I get TinyMCE editor value in jQuery?

function showPreview(value) { $("#preview-container"). load("/material-preview. php", {s:value}); } $('thetextarea'). live("keyup",function (e) { var material = this.


1 Answers

I solved it with code:

// Get the HTML contents of the currently active editor tinyMCE.activeEditor.getContent();  // Get the raw contents of the currently active editor tinyMCE.activeEditor.getContent({format : 'raw'});  // Get content of a specific editor: tinyMCE.get('content id').getContent() 

the activeEditor is current editor,but i use tinyMCE.get('editor1').getContent() can not get the value of my editor, hope it can help you

Tinymce API: http://www.tinymce.com/wiki.php/API3:method.tinymce.Editor.getContent

like image 122
jqpress Avatar answered Oct 01 '22 21:10

jqpress