# LoadDocumentCallback Function

> Callback function which receives information about a loaded document.

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

---

### Description

Callback function which receives information about a loaded document.

### Syntax

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

### Examples

The following example demonstrates `LoadDocumentCallback` in a practical document-editing workflow. Callback function which receives information about a loaded document.

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

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

TXTextControl.load(
    TXTextControl.StreamType.HTMLFormat,
    "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAFgAH/qbPzWQAAAABJRU5ErkJggg==",
    loadDocumentCallback,
    { loadImages: true, loadHypertextLinks: true },
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: ListFormat.setType Method](https://docs.textcontrol.com/ds-server/reference/javascript/listformat/settype-method/llms-full.txt)
- **Next:** [LoadDocumentCallbackData Object](https://docs.textcontrol.com/ds-server/reference/javascript/loaddocumentcallbackdata/llms-full.txt)
