O'Reilly logo

ASP.NET jQuery Cookbook - Second Edition by Sonal Aneel Allana

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Passing data with events and using event namespacing

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

$(this)

jQuery object

This refers to the current jQuery object.

:checked

jQuery selector

This selects all checked checkboxes and radio buttons.

click

jQuery event

This is fired when you click on an element. It corresponds to the JavaScript click event.

.find()

jQuery method

This finds all ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required