event.namespace

The namespace specified when the event was triggered.

.event.namespace()🡢 String

This will likely be used primarily by plugin authors who wish to handle tasks differently depending on the event namespace used.

Determine the event namespace used.

JS
<button>display event.namespace</button>
<p></p>
HTML
$("p").on("test.something", function (event) {
  alert(event.namespace);
});
$("button").click(function (event) {
  $("p").trigger("test.something");
});
DEMO

Looking for a Web Developer?

👋

Hi! I'm Basti, author of this site. If you are looking for a web developer with 15+ years of experience, holla at me!

Be it the good 'ol jQuery, vanilla JS or modern frameworks like Vue and Svelte, front- or backend, I can help you.

Just write me at jobs@jqapi.com :)