를 클릭 나는 다음과 같은 방법 console.log(self)
, 그것은 방법 PMm.test
을 반환액세스는 특정 요소가
PMm.test = function(){
....plenty of code....
$('.element',this.page).click(function(e){
e.preventDefault();
var self = $(this);
console.log(self);
this.load(someoptions)
}.bind(this));
...plenty of code....
}
PMm.test.prototype.load = function(options){
...some code
}
에게 있습니다. $(this)
이 내 이벤트를 선언하는 전체 함수 범위 인 경우 클릭 한 요소에 어떻게 액세스합니까? 나중에 선언 된 .load()
메서드를 호출해야한다는 것을 알았습니다.
왜 클릭 이벤트 함수의 내부는? 이들은 일반적으로 전 세계적으로 설정됩니다. 그것만으로 도움이 될 수도 ... – user1289451