Chat.add_js()#

Chat.add_js(code: str, priority: int = 10)[source]#

Adds Javascript to the element.

This is most useful when writing new elements. To simply add element-related JavaScript code to a page, usually the JavaScript element is a better choice.

Parameters
  • code – JavaScript code

  • priority – Can be used to influence the order in which code is added to the page. Sorting is ascending, i.e. the lowest numbers appear closest to the top of the page.

See also

  • The JavaScript element can be used to add generic JavsScript code to a page.

  • See Element.css_class_element and Element.css_class_container for information on element CSS classes and IDs.