1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 18:32:22 +00:00
Milk Lee c0b0eed507 事件处理函数中的 this 并不是指向全局对象,而是指向绑定事件的节点元素
```js
document.addEventListener('click',function(){console.log(this === document)}); // true
```
从上面这段代码可以看出,事件处理函数里的 `this` 并不是指向 `window` 对象。如果你所说的“全局对象”并不是指 `window` 对象,我也觉得应该阐明这里的“全局对象”到底是指什么,以免产生歧义
2015-07-23 12:43:55 +08:00
..
2015-07-17 08:03:45 +08:00
2015-07-17 08:03:45 +08:00
2015-07-22 09:20:13 +08:00
2015-06-26 07:57:34 +08:00
2015-07-12 20:08:11 +08:00
2015-07-20 16:24:50 +08:00
2015-07-07 08:05:42 +08:00
2015-07-17 18:59:56 +08:00
2015-07-16 15:38:31 +08:00
2015-07-08 16:37:02 +08:00
2015-07-22 09:20:13 +08:00
2015-07-17 08:03:45 +08:00
2015-07-20 16:24:50 +08:00
2015-06-24 09:06:05 +08:00
2015-06-27 15:35:19 +08:00
2015-07-03 16:50:09 +08:00