테스트 사이트 - 개발 중인 베타 버전입니다

event.namespace

· 8년 전 · 2199

event.namespace


설명 : 이벤트가 트리거되었을 때 지정된 네임 스페이스입니다.


이것은 주로 사용 된 이벤트 네임 스페이스에 따라 다르게 작업을 처리하고자하는 플러그인 작성자가 주로 사용합니다.


예:

사용 된 이벤트 네임 스페이스를 결정하십시오.




<!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>

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

게시글 목록

번호 제목
16329
16328
16327
16326
16325
16324
16323
16322
16321
16320
16319
16318
16317
16316
16315
16310
16309
16308
16305
16304
16303
16302
16301
16300
16299
16298
16297
16295
16294
16293