event.namespace

The namespace specified when the event was triggered.

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

event.namespace
version added: 1.4.3
Examples:

Determine the event namespace used.

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>event.namespace demo</title>
  <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
 
<button>display event.namespace</button>
<p></p>
 
<script>
$( "p" ).on( "test.something", function( event ) {
  alert( event.namespace );
});
$( "button" ).click(function( event ) {
  $( "p" ).trigger( "test.something" );
});
</script>
 
</body>
</html>
doc_jQuery
2016-03-27 13:48:17
Comments
Leave a Comment

Please login to continue.