I inherited an application which uses jQuery 1.7.2.
Throughout the application we have code like the below:
$('#quotation').off("click").on("click", function(){
// do something here...
}
Now, I do understand the above no problem. However, occasionaly in our code I come across something like this:
$('#continue').off("click.products").on("click.products", function(){
// do something here...
}
Throughout the application I find click.products
or click.orders
. It seems what ever following the .
can be completly random text.
What is the difference between click
and click.products
?
This code uses custom namespace event defined by them self or by a plugin.
on
docsLive DEMO:
Now when clicking on
#a
both of the clicks handlers (foo and bar) will raise,But when clicking on
#b
only the foo will raise.