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

Popular posts from this blog

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -

php - Redirect and hide target URL -