# Javascript: FrameBase.getTextPosition Method

> Gets the frame's character position in the document's text (one-based).

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: FrameBase.getTextPosition Method
- **336 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/framebase/gettextposition-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/framebase/gettextposition-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/framebase/gettextposition-method/llms-full.txt

---

### Description

Gets the frame's character position in the document's text (one-based).

### Syntax

```javascript
<void> FrameBase.getTextPosition(<RequestNumberCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the current property value. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `FrameBase.getTextPosition` in a practical document-editing workflow. It gets the frame's character position in the document's text (one-based).

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

function inspectTextPosition(frameBase) {
    frameBase.getTextPosition(
        function(result) {
            console.log("get text position result:", result);
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: FrameBase.getTextDistances Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/framebase/gettextdistances-method/llms-full.txt)
- **Next:** [Javascript: FrameBase.setAlignment Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/framebase/setalignment-method/llms-full.txt)
