Created
August 14, 2012 01:50
-
-
Save emphaticsunshine/3345664 to your computer and use it in GitHub Desktop.
Event delegation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // older way in jquery | |
| $('ul').delegate('li','click',function(){ | |
| // do something | |
| }); | |
| //newer way | |
| $("ul").on("click","li",function(){ | |
| // do something | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment