In my script I want to have two types of click functionality, depend on what is clicked and I want to do it in a single function. I decided to make it with namespaces, but the console gives me undefined;
Here is the code:
- $target1.on("click.Bst", $.proxy(self.selectNav, self));
- $target2.on("click.Bst.Type2", $.proxy(self.selectNav, self));
My function selectNav() executes on click, but when I try to get the event.namespace (event is passed as s function parameter) I get undefined.
- selectNav: function(event){
- //other code runs
- console.log(event.namespace); //console log "undefined"
- }