# RequestSectionCallback Function

> Callback function for requests expecting a Section object.

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

---

### Description

Callback function for requests expecting a [Section](https://docs.textcontrol.com/ds-server/reference/javascript/section/llms-full.txt) object.

### Syntax

```javascript
function(<Section> section)
```

### Examples

The following example demonstrates `RequestSectionCallback` in a practical document-editing workflow. Callback function for requests expecting a Section object.

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

function requestSectionCallback(section) {
    console.log("section:", section);
}

TXTextControl.sections.getItem(requestSectionCallback, 1, onTxError);
```

---

## Nearby

- **Previous:** [RequestSectionBreakKindCallback Function](https://docs.textcontrol.com/ds-server/reference/javascript/requestsectionbreakkindcallback/llms-full.txt)
- **Next:** [RequestSelectionBoundsCallback Function](https://docs.textcontrol.com/ds-server/reference/javascript/requestselectionboundscallback/llms-full.txt)
