How to attach an inline event handler using .on() without any callback?
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();
});