var Brower={
// 判断是否为IE6浏览器
isIE6:function(){return navigator.userAgent.search('MSIE')>0&&navigator.userAgent.search('6')>0;},
// 判断是否为IE浏览器
isIE:function(){return navigator.userAgent.search('MSIE')>0;},
// 判断是否为Opera浏览器
isOpera:function(){return navigator.userAgent.indexOf('Opera')>-1;},
// 判断是否为FireFox浏览器
isMoz:function(){return navigator.userAgent.indexOf('Mozilla/5.')>-1;}
}
// 获取DOM节点
function $(i){
if(!document.getElementById)return false;
if(typeof i==="string"){
if(document.getElementById && document.getElementById(i)) {
// W3C DOM
return document.getElementById(i);
}
else if (document.all && document.all(i)) {
// MSIE 4 DOM
return document.all(i);
}
else if (document.layers && document.layers[i]) {
// NN 4 DOM.. note: this won't find nested layers
return document.layers[i];
}
else {
return false;
}
}
else{return i;}
}
文档对象模型(Document Object Model,即 DOM)
Netscape Navigator 4 (NN4)
Macintosh 和 Windows 系统的 Internet Explorer 4 及其更新版本(IE4+)
Safari 中得到实现的 W3C DOM
浏览器类型检测与DOM获取
1954

被折叠的 条评论
为什么被折叠?



