Javascript: Selection.getText Method
Description
Gets the currently selected text.
Syntax
<void> Selection.getText(<RequestStringCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Receives the currently selected text. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates Selection.getText in a practical document-editing workflow. It gets the currently selected text.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.selection.getText(
function(result) {
console.log("get text result:", result);
},
onTxError
);