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

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -