# Template view functions

**This guide is not complete and more will come.**

#### eventOnload

This will ensure that the script inside the `eventOnload` will execute after the component has been executed.

```javascript
this.eventOnload(() => {
    // Your code here
});
```

#### update

You can trigger `this.update` function inside a view to update the component views content.&#x20;

```javascript
this.update();
```

#### setElement

You can set a new or change the current expected **Main** element inside your template view.

```javascript
this.setElement("#your-element");
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://stratox.wazabii.se/stratox.js/advanced-features/template-view-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
