O'Reilly logo

Beginning JavaScript® and CSS Development with jQuery by Richard York

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

Appendix D. Events

The following table contains all of the event methods supported by jQuery as listed in jQuery's official documentation at www.jquery.com.

All of the event methods return the jQuery object.

Method

Description

Page Load

ready(function)

Attaches a function that is executed when the DOM is completely loaded, that is, all markup, CSS, and JavaScript are loaded, but not necessarily images.

Event Handling

bind(event, function)

Attach a function that is executed when the event occurs. Multiple events can be specified in the event argument; if you specify multiple events, each event must be separated with a single space.

bind(event, data, function)

The bind() method accepts an optional data argument. The data argument is an object that is passed to the event object of the attached function as event.data.

one(event, function)

Attaches a function to be fired for the specified event. The function is only executed once. Subsequent events will not execute the specified function.

one(event, data, function)

The one() method accepts an optional data argument. The data argument is an object that is passed to the event object of the attached function as event.data.

trigger(event)

Triggers the specified event on matched elements.

trigger(event, data)

The trigger() method accepts an optional data argument. The data argument is an object that is passed to event object functions being triggered as event.data.

triggerHandler(event)

Triggers the specified event on matched elements while canceling the browser's ...

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