次の2つの方法に違いはありますか? #1は#2より速いですか?
#1
$('#selector').on('click',function(){
$(this)...
// do stuff with clicked element
})
and
#2
$('#selector').on('click',function(e){
$(e.currentTarget)....
// do stuff with clicked element
})
ドキュメント(http://api.jquery.com/を読んでいない、あなたが提供しているものは何でもコンテキストと同じになりますevent.currentTarget /)はあなたに答えを与えていたはずです。 – j08691
このバグレポートは関連しています:http://bugs.jquery.com/ticket/11756。 98%が何をしていると仮定しているので、公式に 'this'を使用してください。 – Medorator