Cathy cfc7ad6282 TODOS(JQuery+Node+Mongo数据库) | 4 years ago | |
---|---|---|
.. | ||
model | 4 years ago | |
public | 4 years ago | |
router | 4 years ago | |
app.js | 4 years ago | |
package-lock.json | 4 years ago | |
package.json | 4 years ago | |
readme.md | 4 years ago |
这样写的话this指向的是触发事件元素本身 taskBox.on('click', '.destroy', function () {
console.log(this);
)};
这样写的话this指向的Window, 因为箭头函数不改变this指向 taskBox.on('click', '.destroy', () => {
console.log(this);
)};