# Javascript: HeaderFooter.activate Method

> Activates the this header or footer.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: HeaderFooter.activate Method
- **374 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/activate-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/activate-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/activate-method/llms-full.txt

---

### Description

Activates the this header or footer.

### Syntax

```javascript
<void> HeaderFooter.activate(<RequestBooleanCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives whether the activation was succesful. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `HeaderFooter.activate` in a practical document-editing workflow. It activates the this header or footer.

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

function activate(headerFooter) {
    headerFooter.activate(
        function(result) {
            if (result) {
                console.log("activate is available.");
            } else {
                console.warn("activate is not available in the current document state.");
            }
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [HeaderFooter Object](https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/llms-full.txt)
- **Next:** [Javascript: HeaderFooter.deactivate Method](https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/deactivate-method/llms-full.txt)
