을 유발하는 방법에 대한 정보를 핸들러에 전달하는 방법은 내가 비슷한 할 수 있지만, 작업 방법이 있는지 알고 싶어이jQuery를 트리거 - 이벤트
$(document).on('click','.someclass',function(){
$('.otherclass').trigger('keyup',{aField:'my data'});
});
$(document).on('keyup','.otherclass',function(e){
console.log(e.aField); // and to have printed 'my data'
});
처럼 뭔가를 완. 왜냐하면 그것은 그렇게 작동하지 않습니다.
은 아마 예는 매우 명확하지 않습니다 : 내가 링크를 클릭하면, 나는
input
에
keyup
이벤트를 트리거 할뿐만 아니라, 나는 그것을 발사 할 때는 객체
{aField:'my data'}
를 전달하려는.
어쨌든 나 자신이 이미 가지고 있습니다. 솔루션은 핸들러에
$(document).on('keyup','.otherclass',function(e,object){
console.log(object.aField); // this printed 'my data'
});
바로 그 페이지를 모두 읽은 후 발견했습니다. – Constantin
듣기가 기쁩니다. D – Valentin