CRecordWebRemoveScript

The CRecordWebRemoveScript message removes a Javascript element.

The message is part of the RemoteSkin Web API.
The API is located in the plugin NY_RemoteSkinWebProtocolAPI.

{
  "id": "ab1cc1ee-0062-4d68-b657-3b0dde496eb8",
  "name": "WEB_REMOVE_SCRIPT",
  "description": "Remove a script.",
  "slots": [
    {
      "key": "1",
      "name": "ID",
      "direction": "REQUEST",
      "mandatory": "true",
      "type": "STRING",
      "description": "The script ID."
    }
  ]
}

Arguments

  • ID : The ID of the Javascript element. JavaScript elements dynamically added to an HTML page should always have a unique ID to allow their removal later. Additionally, it’s important to consider that other microservices may also embed their JavaScript elements dynamically. Therefore, the ID must be truly unique.

Usage with the helper class CWebApi

The easiest way is to call the corresponding method in the CWebApi class. The use of the class is described there.

mWebApi.removeScript(@NotNull final String aId);

Usage as message

The RemoteSkin target address is also required.

public void removeScript(@NotNull final CTargetAddress aRemoteSkinAddress,
                         @NotNull final String aId) throws CException
{
    // Envelope
    final CEnvelope env = CEnvelope.forSingleTarget(mRemoteSkinAddress);
    
    // Record
    final CRecord record = CRecordWebRemoveScript.create();
    CRecordWebRemoveScript.setId(record,
                                 aId);
    
    // send message
    sendNotification(env,
                     record);
}

See also: