TinyMCE:API/tinymce.Editor/setContent
From Moxiecode Documentation Wiki
Contents |
[edit]
Method: setContent
[edit]
Summary
Sets the specified content to the editor instance, this will cleanup the content before it gets set using the different cleanup rules options.
[edit]
Syntax
<String> setContent(<String> h, <Object> o)
[edit]
Parameters
- h
- Content to set to editor, normally HTML contents but can be other formats as well.
- o
- Optional content object, this gets passed around through the whole set process.
[edit]
Returns
HTML string that got set into the editor.
[edit]
Examples
// Sets the HTML contents of the activeEditor editor
tinyMCE.activeEditor.setContent('<span>some</span> html');
// Sets the raw contents of the activeEditor editor
tinyMCE.activeEditor.setContent('<span>some</span> html', {format : 'raw'});
// Sets the bbcode contents of the activeEditor editor if the bbcode plugin was added
tinyMCE.activeEditor.setContent('[b]some[/b] html', {format : 'bbcode'});
