摘要: 初学js的时候,被回调函数搞得很晕,现在回过头来总结一下什么是回调函数。 我们先来看看回调的英文定义:A callback is a function that is passed as an argument to another function and is executed after it 阅读全文
posted @ 2018-01-06 16:38 hallou 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 你可能会发现别人写的代码中有这么一句:var that = this;,这代表什么意思呢? 在javascript中,this代表的是当前对象。 var that=this就是将当前的this对象复制一份到that变量中。this对象在程序中随时会改变,而var that=this之后,that没改 阅读全文
posted @ 2018-01-06 16:33 hallou 阅读(1137) 评论(0) 推荐(0) 编辑