TXTextControlWeb.loadDocument Method

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

Syntax

[JavaScript]
<void> TXTextControlWeb.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.

[JavaScript]
var html = "This is some <b>HTML</b> text.";
var encoded = btoa(html);  // btoa base-64-encodes strings.
TXTextControlWeb.loadDocument(TXTextControl.StreamType.HTMLFormat, encoded);