var isIesix=window.clientInformation.appVersion.indexOf("6.0");
解决方案 »
- js document.getElementById("love").innerHTML 获取p标签js 输出值
- parent.frames.3 为空或不是对象
- 如何判断在页面关闭的时候有数据改动
- 日期格式化问题,高手请进
- 如何利用JAVASCRIPT获取地址栏里的变量再将变量转成另外一个地址?
- 怎么让javascript中支持中文繁体呀?
- 请教!在A页上用window.showmodaldialog()打开一个窗口B,在B里怎样将A关掉?
- 如何使父窗口关闭时,也使子窗口同时关闭呀
- 希望获得高手帮助
- ESLint报错( Expected an assignment or function call and instead saw an expression)
- 能否对一个事件提供两个以上的处理函数,当事件发生时,能依次调用这几个函数?
- 关于iframe中页面表单提交的问题
function checkBrowser(){
this.ver=navigator.appVersion
this.dom=document.getElementById?1:0
this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.mac=(this.ver.indexOf('Mac') > -1) ?1:0;
this.ope=(navigator.userAgent.indexOf('Opera')>-1);
this.ie=(this.ie6 || this.ie5 || this.ie4)
this.ns=(this.ns4 || this.ns5)
this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns5 || this.ns4 || this.mac || this.ope)
this.nbw=(!this.bw)
return this}
<!--
function checkBrowser()
{
this.ver=navigator.appVersion
this.dom=document.getElementById?1:0
this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.mac=(this.ver.indexOf('Mac') > -1) ?1:0;
this.ope=(navigator.userAgent.indexOf('Opera')>-1);
this.ie=(this.ie6 || this.ie5 || this.ie4)
this.ns=(this.ns4 || this.ns5)
this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns5 || this.ns4 || this.mac || this.ope)
this.nbw=(!this.bw) return this;
}var a = new checkBrowser();if(a.ie6)
{
alert("是IE6");
}
//-->
</SCRIPT>
alert(parseFloat(ver.substr(ver.indexOf("MSIE")+5))); //version
? :
相当于
if(){}
else{}
if(isIesix==-1) 不是ie6
其它版本同理