Javascript: TXTextControl.loadDocument Method

Loads text in a certain format. The complete contents of the web editor are replaced.

Syntax

<void> TXTextControl.loadDocument(<StreamType> streamType, <String> base64Data);
Parameter Description
streamType

Specifies one of the numerical StreamType values.

base64Data

Base64 encoded document data.

Example

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);

See Also