16
以下两种方法有什么区别吗?比#2快#1?
#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