I know I have the ability to namespace events using jQuery's, $.fn.on, off and trigger functions. Is it possible to set up a handler that is able to listen to ALL events in a certain namespace?
Such as:
$(window).on(".event_namespace", function(e){
//handler
});
$(window).trigger("testEvent.event_namespace");
$(window).trigger("testEventTwo.event_namespace");
With the intended behavior being that the listener would capture any event triggered with the specified namespace...
The end-goal is simply to be able to listen to a group of events that will actually be fired by code that I don't have access too. I'd like to be able to say, "just add your event to this namespace," and then be able to capture those without needing to know the event names themselves; only the namespace.
Possible?