直接上代码:
var temp = this.innerEvent ;
if(temp != null) temp(this , msg);
为什么事件执行的时候,需要将其赋值给一个临时变量,有临时变量去执行呢?
请求大牛们给讲解吖! 跪谢!!!
直接上代码:
var temp = this.innerEvent ;
if(temp != null) temp(this , msg);
为什么事件执行的时候,需要将其赋值给一个临时变量,有临时变量去执行呢?
请求大牛们给讲解吖! 跪谢!!!
这不是必须的,也可以写
if(this.innerEvent != null) this.innerEvent(this , msg);