大家都知道互联网中可以判断操作系统的版本(windows 2000,windows xp),有没有可能判断操作系统的具体版本呢?如windows 2000 professional,windows 2000 server和sp版本???代码是什么?

解决方案 »

  1.   

    2个例子.自己看.
        var nav=window.navigator.userAgent;
        var osVFull=nav.split(";")[2];
        var osV=osVFull.substr(osVFull.length-3,3); 
        switch(osV)
        {
            case "5.0": 
                alert("是2000系统"); 
                break;
            case "5.1":  
                alert("是xp系统"); 
                break;
            case "5.2":  
                alert("是03系统"); 
                break;
        }  
    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; 
      

  2.   

    alert(var nav=window.navigator.userAgent);