# Javascript: TableOfContents.getHasLinks Method

> Gets value specifying whether each entry in the table of contents is a DocumentLink with a corresponding DocumentTarget.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 29.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: TableOfContents.getHasLinks Method
- **408 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/tableofcontents/gethaslinks-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/tableofcontents/gethaslinks-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/tableofcontents/gethaslinks-method/llms-full.txt

---

### Description

Gets value specifying whether each entry in the table of contents is a DocumentLink with a corresponding DocumentTarget.

### Syntax

```javascript
<void> TableOfContents.getHasLinks(<RequestBooleanCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

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

### Examples

The following example demonstrates `TableOfContents.getHasLinks` in a practical document-editing workflow. It gets value specifying whether each entry in the table of contents is a DocumentLink with a corresponding DocumentTarget.

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

function inspectHasLinks(tableOfContents) {
    tableOfContents.getHasLinks(
        function(result) {
            if (result) {
                console.log("get has links is available.");
            } else {
                console.warn("get has links is not available in the current document state.");
            }
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [TableOfContents Object](https://docs.textcontrol.com/ds-server/reference/javascript/tableofcontents/llms-full.txt)
- **Next:** [Javascript: TableOfContents.getHasPageNumbers Method](https://docs.textcontrol.com/ds-server/reference/javascript/tableofcontents/gethaspagenumbers-method/llms-full.txt)
