Developers
Search…
JavaScript API Command Overview

About commands

You interact with the JavaScript API through commands. Commands are represented by arrays whose first element is the command name, and subsequent elements (if any) correspond to the command's parameters.

Example of a command array

1
["command1", argument1a, argument1b]
Copied!
LYNX's Javascript library collects commands issued by the JavaScript API running on your website and stores them for later execution in a queue (command queue) inside a global object named kd.

The kdcommand queue

It's a global object and it's called command queue because rather than executing the commands it receives immediately, it adds them to a queue. To add a command to the queue you must invoke its push method. The actual execution is initiated only when the special submit command (having no parameters) is added to the command queue; after execution is completed, the command queue is emptied.

Example

1
kd.push(["command1", argument1a, argument1b, ...]);
2
kd.push(["command2", argument2a, argument2b, ...]);
3
...
4
kd.push(["submit"]);
Copied!
Last modified 6mo ago