Javascript: Footnote.getNumber Method
Description
Gets the footnote's number in the text. The first footnote in the document has the number 1. The number is defined through the textflow.
Syntax
<void> Footnote.getNumber(<RequestNumberCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Receives the property value. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates Footnote.getNumber in a practical document-editing workflow. It gets the footnote's number in the text. The first footnote in the document has the number 1. The number is defined through the textflow.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.footnotes.elementAt(0, function(footnote) {
if (!footnote) {
console.warn("No footnote is available.");
return;
}
footnote.getNumber(
function(result) {
console.log("get number result:", result);
},
onTxError
);
}, onTxError);