I have always used in the past:
$(selector).on('click', function )
But today I was binding this on an object that came in after docready ( from ajax a call ). The binding would not stick.
After googling I saw this:
$(document).on( event, selector, function )
syntax. And after changing to this, my code was working.
I have been on a break from jquery and feel like I've missed something, are there a real differences in these 2 methods? What are they?
Is this latter syntax the only way now to do bindings on new elements ( the purpose livequery plugin used to serve ) ?