document.all
来源:互联网 发布:手机用户mac绑定错误 编辑:程序博客网 时间:2024/05/16 10:46
一种一般用作识别IE浏览器的方法.
可以判断兼容性
IE下
if(document.all)
返回 true
firefox下
if(document.all)
返回 false
感谢 sohighthesky 分享的方法
!!window.ActiveXObject&&!window.XMLHttpRequest
var isIE=!!window.ActiveXObject;
var isIE6=isIE&&!window.XMLHttpRequest;
var isIE8=isIE&&!!document.documentMode;
var isIE7=isIE&&!isIE6&&!isIE8;
if (isIE){
if (isIE6){
alert(”ie6″);
}else if (isIE8){
alert(”ie8″);
}else if (isIE7){
alert(”ie7″);
}
}
可以判断兼容性
IE下
if(document.all)
返回 true
firefox下
if(document.all)
返回 false
感谢 sohighthesky 分享的方法
sohighthesky 写道
识别ie我用
window.ActiveXObject
!+'\v1'
!-[1,]
现在更喜欢用短的了
window.ActiveXObject
!+'\v1'
!-[1,]
现在更喜欢用短的了
引用
!!window.ActiveXObject&&!window.XMLHttpRequest
var isIE=!!window.ActiveXObject;
var isIE6=isIE&&!window.XMLHttpRequest;
var isIE8=isIE&&!!document.documentMode;
var isIE7=isIE&&!isIE6&&!isIE8;
if (isIE){
if (isIE6){
alert(”ie6″);
}else if (isIE8){
alert(”ie8″);
}else if (isIE7){
alert(”ie7″);
}
}
0 0
- document.all[]
- document.all
- document.all
- document.all
- document.all()
- document.all
- document.all
- document.all
- document.all
- document.all
- document.all
- document.all
- document.all & document.getElementsByName?
- Document 和 Document.all
- document.layers document.all
- document.all还是document.getElementsByName?
- document.all和document.getElementById
- document.all还是document.getElementsByName?
- 广告常用概念小结
- java通过c调用python
- Ubuntu Linux下安装Oracle JDK
- 有关UITableView的contentSize、contentInset和contentOffset
- ios中的变量和属性
- document.all
- VC 保存数据
- Raw-OS源码分析之事件标志
- POJ 3767 I Wanna Go Home 最短路
- GameServer
- shell中的特殊变量
- C程序调用shell脚本共有三种方法
- Solr4.5+mmseg4j-1.9.1的简单配置
- 浮点数float 处理注意事项