2017-09-14 6 views
0

https://github.com/brandonaaron/livequery .livequery() 구문을 찾으려고했습니다. 나는 공식 문서가 무엇을 볼 수에서 .livequery()는 두 개 또는 세 개의 매개 변수를받을 수 있습니다.livequery()는 하나의 매개 변수 만받는 경우 어떻게 작동합니까?

// selector: the selector to match against 
// matchedFn: the function to execute when a new element is added to the DOM that matches 
$(...).livequery(selector, matchedFn); 

// selector: the selector to match against 
// matchedFn: the function to execute when a new element is added to the DOM that matches 
// unmatchedFn: the function to execute when a previously matched element is removed from the DOM 
$(...).livequery(selector, matchedFn, unmatchFn); 

는 그러나, 나는 검사하고 소스 코드에, 내가 .livequery()가 하나 개의 매개 변수를 수신 참조하십시오. 예를 들면 : 나는 공식 문서에 표시되는 내용을 기반으로 이해하고 어떤에서

$('.js-truncate').livequery(function() { 
    .................................. 
}); 

는 .livequery의 첫 번째 매개 변수()는 항상 "선택"입니다. .livequery()가 단일 매개 변수를받는 경우, 내 매개 변수 인이 매개 변수는 무엇을 의미합니까? : function() {.......}. 고맙습니다.

답변

0

지금부터는 jQuery를 업그레이드 한 이후로 .on을 사용할 것이므로 지금은 관련이 없습니다.