7 Controller "API" - lebaston100/htmlOverlayFramework GitHub Wiki

The controller enables you to easily communicate with all the clients. They are available on the controller side through communicator.js

sendCommand(command, content);

Sends a command to all connected controller and clients

  • command: Something to seperate your request. (Text or json object/array)
  • content: The content to send. (Text or json object/array)

Example


changeElementContent(id, newContent);

Changes the content of the object(e.g. changing text in a div or span)

  • id: The id of the element to change
  • newContent: The new content to change to (html tags supported)

Example


getInput(id);

Reads the input of an html <input> object

  • id: The id of the <input> object to read

Example


doConnect();

Connect to the Server. This should not be needed because the controller automatically connects when loading the page.

Example


doDisconnect();

Disconnect from the Server

Example

⚠️ **GitHub.com Fallback** ⚠️