Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think you misread this. It does not bind the same instance of the handler to each element. Each element gets its own copy of this handler, hence the waste of memory.


What? No they don't, unless you're making the handler in a loop.

$( "div" ).click( function() {} );

Each div will have the same handler applied, it doesn't make a new one for every div.


You're confusing the callback with the actual event listener.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: