event.namespace

event.namespace 官网原E文: String

描述: 当事件被触发时此属性包含指定的命名空间。

  • version added: 1.4.3event.namespace

Example:

确定事件在命名空间中使用。

<!DOCTYPE html>
<html>
<head>
  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
  
<button>display event.namespace</button>
<p></p>

<script>
$("p").bind("test.something", function(event) {
  alert( event.namespace );
});
$("button").click(function(event) {
  $("p").trigger("test.something");
});  
</script>

</body>
</html>

Demo:

jQuery 1.6 API 中文版Clove整理、修订