请问有人能解释一下它们之间的区别吗?
例如,我可以用“that”来做到这一点:
var bar;
button.click(function () {
if (bar == this) {
alert('same');
}
bar = this;
});
并且无法使用 $(that):
var bar;
button.click(function(){
if(bar == $(this)) {alert('same');}
bar = $(this);
});