what it means on( 'click.something', function() {..}); in jquery? -
i familiar structure below:
on('click', function() {..}); but found somewhere type structure
on('click.something', function() {..}); what means or difference?
that's namespace.
on click.something , something namespace can bind , unbind event suppose if provide namespace in code can unbind event. see example below:
$(selector).on('click.something',function(){ //do stuff here //and after click can unbind event this: $(selector).off('click.something'); //but won't work $(selector).off('click'); }); see more using namespace:
Comments
Post a Comment