Binds events found as data-* tags to the current object
bindEvents(selector, subject)
selector |
string, selector where to inspect data-* properties |
subject |
object, this subject should have correct methods |
This function allows you to define events in HTML and then bind them to the object. It is used internally for all
of the objects to avoid using inline events with JavaScript as it is a potential security volnurability. Most recent
Content Security Policies (CSP) have a quick qay to disable inline JavaScript.
For eample if you have a div defined in HTML as
You can bind events to a custom object in the folliwing way
The general format is