Obsolete. This method will be removed in one of the next versions. Loads text in a certain format into the current selection.

Introduced: X13.

<void> TXTextControl.loadSelection(<StreamType> streamType, <string> base64Data)

Parameters

Parameter Description
streamType Specifies one of the numerical StreamType values.
base64Data Base64 encoded document data.

Examples

The following example shows how to load a short HTML document into the web editor.

var html = "This is some <b>HTML</b> text."; 

var encoded = btoa(html); // btoa base-64-encodes strings. 

TXTextControl.loadDocument(TXTextControl.StreamType.HTMLFormat, encoded);

Further Reading

Learn more about the Javascript: TXTextControl.loadSelection Method in the Text Control Blog: