这个data.target == this
是如何工作的?这段代码做了什么? “data.target == this”
jQuery的例子
.mouseup(function(data, handler)
{
if(data.target == this)
{
// some code
}
})
这是否比较通过比较它们各自的属性的对象?
我需要这个检查,因为我只想在父div和一个孩子上使用mouseup。
if (data.target == this || * if this has className XXX *) {
// some code
}
http://rayfd.wordpress.com/2007/03/18/really-understanding-javascripts-equality-and-identity/ –