In this recipe, we will demonstrate how to pass event data with the .trigger()
method. The event data will be defined in the JavaScript Object Notation (JSON) format, which is simply a collection of name/value pairs. We will also see how to use namespacing on the same event type to execute different handlers. The constructs used in this example are as follows:
Construct |
Type |
Description |
---|---|---|
|
jQuery object |
This refers to the current jQuery object. |
|
jQuery selector |
This selects all checked checkboxes and radio buttons. |
|
jQuery event |
This is fired when you click on an element. It corresponds to the JavaScript |
|
jQuery method |
This finds all elements matching the filter. |
|
jQuery event binder |
This attaches an event handler for one or more events to the matched elements. |
|
jQuery method |
This executes handlers and behaviors attached to the matched elements. |
|