jQuery has a more flexible way to bind to events. Could be useful for us. #539

Closed
mmzeeman opened this Issue Mar 15, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@mmzeeman
Owner

mmzeeman commented Mar 15, 2013

As of jQuery 1.7, the .on() method is the preferred method for attaching event handlers to a document. For earlier versions, the .bind() method is used for attaching an event handler directly to elements. Handlers are attached to the currently selected elements in the jQuery object, so those elements must exist at the point the call to .bind() occurs. For more flexible event binding, see the discussion of event delegation in .on() or .delegate().

@mmzeeman

This comment has been minimized.

Show comment Hide comment
@mmzeeman

mmzeeman Mar 16, 2013

Owner

In f493bd5 I swapped out .bind in favour of .on. This is harmless this was actually called inside jQuery.

With .on you can also do event delegation which I want to add later.

Owner

mmzeeman commented Mar 16, 2013

In f493bd5 I swapped out .bind in favour of .on. This is harmless this was actually called inside jQuery.

With .on you can also do event delegation which I want to add later.

@mworrell mworrell added this to the Enhancements for later milestone Apr 22, 2015

@mworrell mworrell closed this Apr 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment