How to attach an inline event handler using .on() with the jQuery token?
Compact syntax with timing methods:
1
$('.some').on('click',$).doSome().jQueryStuff();
The return value of .on() is an inline handler if the callback function is skipped or given as jQuery token $.
Compare this to the old way with more syntactic fluff:
1
2
3
$('.some').on('click', function(){
$(this).doSome().jQueryStuff();
});