TX Text Control .NET Server

Javascript: MisspelledWord.getNumber Method

Method|Introduced in 28.0

Description

Gets the number of this misspelled word. All misspelled words are counted from the beginning to the end of a document. The first word has the number 1.

Syntax

<void> MisspelledWord.getNumber(<RequestNumberCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the number of this misspelled word.

errorCallback

Optional. Is called when the operation failed with an error.

Examples

The following example demonstrates MisspelledWord.getNumber in a practical document-editing workflow. It gets the number of this misspelled word. All misspelled words are counted from the beginning to the end of a document. The first word has the number 1.

function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

function inspectNumber(misspelledWord) {
    misspelledWord.getNumber(
        function(result) {
            console.log("get number result:", result);
        },
        onTxError
    );
}