# RequestParagraphCallback Function

> Callback function for requesting a Paragraph object.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Function
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > RequestParagraphCallback Function
- **287 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/requestparagraphcallback/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/requestparagraphcallback/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/requestparagraphcallback/llms-full.txt

---

### Description

Callback function for requesting a [Paragraph](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/paragraph/llms-full.txt) object.

### Syntax

```javascript
function(<Paragraph> result)
```

### Examples

The following example demonstrates `RequestParagraphCallback` in a practical document-editing workflow. Callback function for requesting a Paragraph object.

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

function requestParagraphCallback(result) {
    console.log("result:", result);
}

TXTextControl.textParts.getMainText(function(mainText) {
    const paragraphs = mainText.paragraphs;
    paragraphs.getItem(-1, requestParagraphCallback, onTxError);
}, onTxError);
```

---

## Nearby

- **Previous:** [RequestPaperSizeCallback Function](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/requestpapersizecallback/llms-full.txt)
- **Next:** [RequestParagraphFormatCallback Function](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/requestparagraphformatcallback/llms-full.txt)
