Example 1 — Official Demo: Read the Namespace
Bind test.something, trigger it from a button, show event.namespace.
$("#target").on("test.something", function (event) {
$("#out").text('event.namespace = "' + event.namespace + '"');
});
$("#fire").on("click", function () {
$("#target").trigger("test.something");
}); How It Works
- Bind.
test.somethingsplits into typetestand namespacesomething. - Trigger. The button calls
.trigger("test.something")on#target. - Read. The handler logs
event.namespace— not the full bind string.

