function AddJsCommand::render
Return an array to be run through json_encode and sent to the client.
Overrides CommandInterface::render
File
- 
              core/
lib/ Drupal/ Core/ Ajax/ AddJsCommand.php, line 53  
Class
- AddJsCommand
 - An AJAX command for adding JS to the page via AJAX.
 
Namespace
Drupal\Core\AjaxCode
public function render() {
  return [
    'command' => 'add_js',
    'selector' => $this->selector,
    'data' => $this->scripts,
  ];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.