# On JavaScript Callback

## Overview

![The On JavaScript Callback Node.](/files/5xDVn60PSQh1DaE1IG2N)

**On JavaScript Callback** is an **Event Listener** **Node** used for executing a **Logic Branch** when a JavaScript function is called. This function needs to be defined in the **Web Sprite** that is given as **Object** **Attribute**.

[**Scope**](/incari-studio/2023.1/toolbox/overview.md#scopes): **Scene**, **Prefab**.

## Attributes

![The On JavaScript Callback Node.](/files/ctzNghJBdKhUdnE8Pa04)

### Object

| Attribute | Type         | Description                                                                                                          |
| --------- | ------------ | -------------------------------------------------------------------------------------------------------------------- |
| `Object`  | **ObjectID** | **Web Sprite** **Object** that contains the callback function, if none is given in the `Object ID` **Input Socket**. |

### Function

| Attribute          | Type       | Description                                                                                                         |
| ------------------ | ---------- | ------------------------------------------------------------------------------------------------------------------- |
| `JS Function Name` | **String** | The name of the function that will trigger the **Logic**, if none is given in the `Function name` **Input Socket**. |

### Outputs

#### Data Types

| Attribute        | Type          | Description                                                         |
| ---------------- | ------------- | ------------------------------------------------------------------- |
| `Data Types [n]` | **Drop-down** | Label and **Data Type** of the corresponding **Output** **Socket**. |

## Inputs

| Input           | Type         | Description                                                                        |
| --------------- | ------------ | ---------------------------------------------------------------------------------- |
| `Object ID`     | **ObjectID** | **Web Sprite** **Object** that contains the callback function.                     |
| `Function name` | **String**   | The name of the function that will trigger the **Logic**.                          |
| `Subscribe` (►) | **Pulse**    | An **Input Pulse** that needs to be triggered to start listening to the **Event**. |

## Outputs

| Output             | Type                                         | Description                                                                                                                            |
| ------------------ | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| *Pulse Output* (►) | **Pulse**                                    | A standard **Output Pulse**, to move onto the next **Node** along the **Logic Branch**, once this **Node** has finished its execution. |
| `Parameter`        | *Defined in the `Data Type`* ***Attribute*** | Parameter received by the callback function.                                                                                           |
| `Object ID`        | **ObjectID**                                 | **Web Sprite** **Object** received as **Input**.                                                                                       |

## See Also

* [**Call JavaScript Function**](/incari-studio/2023.1/toolbox/web/call-javascript-function.md)


---

# 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://docs.incari.com/incari-studio/2023.1/toolbox/events/web/on-javascript-callback.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.
