tadam logo
Did you find an error in the text?
Select this with mouse and press
Ctrl + Enter
Xhtml.co.il Check Spelling
Orphus system

event.namespace

event.namespace

Returns: String

Description: This attribute contains the namespace specified when the event was triggered.

event.namespace

version added: 1.4.3

Examples

Determine the event namespace used.
$("p").bind("test.something", function(event) {
  alert( event.namespace );
});
$("button").click(function(event) {
  $("p").trigger("test.something");
});  
The output of the code above will be:

Full source:

<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
  <script type="text/javascript" language="javascript">
     $(document).ready(function(){
$("p").bind("test.something", function(event) {
  alert( event.namespace );
});
$("button").click(function(event) {
  $("p").trigger("test.something");
});  
     });
  </script>
</head>
<body>
  <button>display event.namespace</button>
<p></p>
</body>
</html>
Was this information helpful?
   

Comments