不同的浏览器对JS事件的解析不同,主流浏览器中,事件对象可以在事件的回调函数中通过参数的方式传入,就是常见的function(e){
}。但是低版本的浏览器中,获取事件对象的方式是window.event。
所以,e = e||event是一种兼容的写法。
getEvnt:function(e){
let e = ( e != null ) ? e : window.event;
return e;
}
或者:
getEvnt:function(e){
return e ? e : window.event;
}