var isIesix=window.clientInformation.appVersion.indexOf("6.0");

解决方案 »

  1.   

    我只想知道是IE5,还是IE6,怎么做
      

  2.   

    参考这个
    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}
      

  3.   

    <SCRIPT LANGUAGE="JavaScript">
    <!--
    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>
      

  4.   

    var ver         = window.navigator.appVersion;
    alert(parseFloat(ver.substr(ver.indexOf("MSIE")+5))); //version
      

  5.   

    倒~
    ? :
    相当于
    if(){}
    else{}
      

  6.   

    var isIesix=window.clientInformation.appVersion.indexOf("6.0");
    if(isIesix==-1) 不是ie6
    其它版本同理