# RequestTextFrameCallback Function

> Callback function for requests creating and adding a new TextFrame object to a text frame collection.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Function
- **Path:** DS Server > Reference > JavaScript API > RequestTextFrameCallback Function
- **265 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/requesttextframecallback/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/requesttextframecallback/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/requesttextframecallback/llms-full.txt

---

### Description

Callback function for requests creating and adding a new [TextFrame](https://docs.textcontrol.com/ds-server/reference/javascript/textframe/llms-full.txt) object to a text frame collection.

### Syntax

```javascript
function(<TextFrame> textFrame)
```

### Examples

The following example demonstrates `RequestTextFrameCallback` in a practical document-editing workflow. Callback function for requests creating and adding a new TextFrame object to a text frame collection.

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

function requestTextFrameCallback(textFrame) {
    console.log("text frame:", textFrame);
}

TXTextControl.textFrames.getItem(requestTextFrameCallback, onTxError, 25);
```

---

## Nearby

- **Previous:** [RequestTextFormFieldCallback Function](https://docs.textcontrol.com/ds-server/reference/javascript/requesttextformfieldcallback/llms-full.txt)
- **Next:** [RequestTextPartCallback Function](https://docs.textcontrol.com/ds-server/reference/javascript/requesttextpartcallback/llms-full.txt)
