Creating an AgentApp Widget

The JavaScript code agentapp.min.js, that is provided with Jacada Interaction Server, contains all elements that are necessary to create and manipulate the AgentApp widget. Creating a new AgentApp instance involves calling the AgentApp class constructor. This constructor creates a new AgentApp widget under a given HTML container (typically a DIV element).

The format of the constructor is:

AgentApp(container:Node, options?:AgentOptions, onAgentAppReady?:function)

Input parameters are described in the following table.

Parameter

Description

Node

The HTML container that holds the Agent app.

AgentOptions

A set of properties that defines how the Agent app looks and behaves. For details, refer to AgentOptions Object Specification.

onAgentAppReady

The function to be called when the Agent app finishes rendering.

The parent element in which the AgentApp component will be shown is passed, as well as an agentOptions object that influences the way the AgentApp widget looks and operates. (For more information about agentOptions, refer to AgentOptions Object Specification.)

The onAgentAppReady function is called after the UI is ready. Typically the function would be called to load a specific interaction (i.e., startInteraction) or to load an Interaction instance history (i.e., loadHistory).