Loads text in a certain format. The complete contents of the web editor are replaced.
Introduced: X13.
<void> TXTextControl.loadDocument(<StreamType> streamType, <string> base64Data, <LoadDocumentCallback> callback, [<LoadSettings> loadSettings], [<ErrorCallback> errorCallback])
Parameter | Description |
---|---|
stream |
Specifies one of the numerical Stream |
base64Data | Base64 encoded document data. For encoding strings containing characters outside of the Latin1 range use TXText |
callback | Receives information about the loaded data when the loading is finished. |
load |
Optional. Additional settings for loading the data. |
error |
Optional. Is called when the operation failed with an error. |
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);
Learn more about the Javascript: TXText