# JS functions to trigger chat widget

Javascript functions to display and hide the chat widget on your webpage.

Execute the following Javascript functions to trigger the chat widget on your web page.

#### Opening the chat widget <a href="#opening-the-chat-widget" id="opening-the-chat-widget"></a>

Copy

```
wn.open(); 
```

#### Closing the chat widget <a href="#closing-the-chat-widget" id="closing-the-chat-widget"></a>

Copy

```
wn.close();
```

#### Hiding the chat widget <a href="#hiding-the-chat-widget" id="hiding-the-chat-widget"></a>

Copy

```
wn.hideWidget();
```

#### Showing the chat widget <a href="#showing-the-chat-widget" id="showing-the-chat-widget"></a>

Copy

```
wn.showWidget();
```


---

# 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://help.wotsabot.ai/wotsabot-help-articles/trouble-shooting/js-functions-to-trigger-chat-widget.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.
