javascript obj['e'+ type + fn] 什么意思
javascriptfunctionaddEvent(obj,type,fn){if(obj.addEventListener){obj.addEventListener...
javascript
function addEvent(obj, type, fn){
if (obj.addEventListener){
obj.addEventListener(type, fn, false);
}
else if (obj.attachEvent){
obj['e'+ type + fn] = fn;
obj.detachEvent('on'+ type, obj['e'+ type + fn]);
obj.attachEvent('on'+ type, obj['e'+ type + fn]);
}
}
obj['e'+ type + fn] 数组吗? 怎么是字符串呢,不明白 展开
function addEvent(obj, type, fn){
if (obj.addEventListener){
obj.addEventListener(type, fn, false);
}
else if (obj.attachEvent){
obj['e'+ type + fn] = fn;
obj.detachEvent('on'+ type, obj['e'+ type + fn]);
obj.attachEvent('on'+ type, obj['e'+ type + fn]);
}
}
obj['e'+ type + fn] 数组吗? 怎么是字符串呢,不明白 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询