AddJsCommand
Last updated on
13 September 2025
AddJsCommand is not needed in an HTMX implementation. Assets included in the response that are not already present are merged into the target page.
If you are building or maintaining a route for the request, see Adding assets (CSS, JS) to a Drupal module via *.libraries.yml for more information about returning JavaScript.
Help improve this page
Page status: No known problems
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion
Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.