Trying to get comfortable with jQuery and I have encountered some sample code that I am having trouble understanding. It refers to the bind method and the way they use it. Here it is
$('textControl').bind(($.browser.opera ? 'keypress', 'keydown') + '.autocomplete', function(event) { code...});
I understand the selection of either keypress or keydown but what I dont understand is why they attach the .autocomplete on the even handler name?
if anyone can shed some light that would be great
Thanks
This is a features of jQuery called Namespaced Evenets which is often used within Plugins as it allows an easy and quick way for a plugin to only manipulate it’s own events.