api的设计要求是判断参数是否为Element对象。
?
首先我们看看各大开源框架的源码:
?
1、prototype 1.6.0
?
?
isElement: function(o){
return o && o.nodeType == 1;
}
?
2、tangram
?
?
isElement : function(o){
return !!(o && o.nodeName && o.nodeType == 1);
}
api的设计要求是判断参数是否为Element对象。
?
首先我们看看各大开源框架的源码:
?
1、prototype 1.6.0
?
?
isElement: function(o){
return o && o.nodeType == 1;
}
?
2、tangram
?
?
isElement : function(o){
return !!(o && o.nodeName && o.nodeType == 1);
}