亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

JS代碼實(shí)現(xiàn)電腦配置檢測(cè)功能

 更新時(shí)間:2018年03月21日 09:21:20   作者:沐楓自然  
這篇文章主要介紹了JS代碼實(shí)現(xiàn)電腦配置檢測(cè)功能,需要的朋友可以參考下

下面一段代碼給大家分享js代碼實(shí)現(xiàn)電腦配置檢測(cè)功能,具體代碼如下所示:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title></title>
  </head>
  <style type="text/css">
    h1 {
      text-align: center;
      color: #000046;
    }
    .i {
      display: inline-block;
      vertical-align: middle;
      width: 30px;
      height: 30px;
      margin: 5px 20px;
      background: url(http://yi.sunlands.com/ent-portal-war/images/tc_icon.png) no-repeat;
    }
    .a {
      background-position: 0 0;
    }
    .b {
      background-position: 0 -40px;
    }
    .c {
      background-position: 0 -80px;
    }
    .d {
      background-position: 0 -120px;
    }
    .e {
      background-position: 0 -160px;
    }
    b {
      color: #007ac3;
      padding-right: 10px;
    }
    i {
      color: green;
      font-weight: bold;
    }
    .box {
      width: 460px;
      height: 360px;
      margin: auto;
      padding: 20px;
      border: 2px solid darkgray;
      font-size: 18px;
      border-radius: 10px;
      border-left-width: 10px;
      border-right-width: 10px;
    }
  </style>
  <body>
    <h1>電腦配置檢測(cè)</h1>
    <hr />
    <div class="box">
      <p> <i class="i a"></i> <b>您的操作系統(tǒng)是: </b> <i id="xitong"></i> </p>
      <p> <i class="i b"></i> <b>您的網(wǎng)絡(luò)鏈接狀態(tài)是: </b> <i id="netline"></i> </p>
      <p> <i class="i b"></i> <b>您當(dāng)前瀏覽網(wǎng)速是:</b> <i id="wangsu"></i> </p>
      <p> <i class="i c"></i> <b>您電腦的分辨率是:</b> <i id="fenbianlv"></i> </p>
      <p> <i class="i d"></i> <b>您的瀏覽器是:</b> <i id="liulanqi"></i> </p>
      <p> <i class="i e"></i> <b>您的flash的版本是:</b> <i id="flash_banben"></i> </p>
    </div>
  </body>
  <script src="jquery-1.12.4.min.js" type="text/javascript" charset="utf-8"></script>
  <script type="text/javascript">
    $(function(){
      if(typeof Obj == "undefined") {
        var Obj = new Object();
      }
      if(typeof Obj.SWFObjectUtil == "undefined") {
        Obj.SWFObjectUtil = new Object();
      }
      Obj.SWFObject = function(_1, id, w, h, _5, c, _7, _8, _9, _a) {
        if(!document.getElementById) return;
        this.params = new Object();
        this.variables = new Object();
        this.attributes = new Array();
        if(_1) this.setAttribute("swf", _1);
        if(id) this.setAttribute("id", id);
        if(w) this.setAttribute("width", w);
        if(h) this.setAttribute("height", h);
        if(_5) this.setAttribute("version", new Obj.PlayerVersion(_5.toString().split(".")));
        this.installedVer = Obj.SWFObjectUtil.getPlayerVersion();
        if(!window.opera && document.all && this.installedVer.major > 7) {
          Obj.SWFObject.doPrepUnload = true;
        }
        if(c) this.addParam("bgcolor", c);
        var q = _7 ? _7 : "high";
        this.addParam("quality", q);
        this.setAttribute("useExpressInstall", false);
        this.setAttribute("doExpressInstall", false);
        var _c = (_8) ? _8 : window.location;
        this.setAttribute("xiRedirectUrl", _c);
        this.setAttribute("redirectUrl", "");
        if(_9) this.setAttribute("redirectUrl", _9);
      };
      Obj.SWFObject.prototype = {
        useExpressInstall: function(_d) {
          this.xiSWFPath = !_d ? "expressinstall.swf" : _d;
          this.setAttribute("useExpressInstall", true);
        },
        setAttribute: function(_e, _f) {
          this.attributes[_e] = _f;
        },
        getAttribute: function(_10) {
          return this.attributes[_10];
        },
        addParam: function(_11, _12) {
          this.params[_11] = _12;
        },
        getParams: function() {
          return this.params;
        },
        addVariable: function(_13, _14) {
          this.variables[_13] = _14;
        },
        getVariable: function(_15) {
          return this.variables[_15];
        },
        getVariables: function() {
          return this.variables;
        },
        getVariablePairs: function() {
          var _16 = new Array();
          var key;
          var _18 = this.getVariables();
          for(key in _18) {
            _16[_16.length] = key + "=" + _18[key];
          }
          return _16;
        },
        getSWFHTML: function() {
          var _19 = "";
          if(navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) {
            if(this.getAttribute("doExpressInstall")) {
              this.addVariable("MMplayerType", "PlugIn");
              this.setAttribute("swf", this.xiSWFPath);
            }
            _19 = "<embed type=\"application/x-shockwave-flash\" src=\"" + this.getAttribute("swf") + "\" width=\"" + this.getAttribute("width") + "\" height=\"" + this.getAttribute("height") + "\" style=\"" + this.getAttribute("style") + "\"";
            _19 += " id=\"" + this.getAttribute("id") + "\" name=\"" + this.getAttribute("id") + "\" ";
            var _1a = this.getParams();
            for(var key in _1a) {
              _19 += [key] + "=\"" + _1a[key] + "\" ";
            }
            var _1c = this.getVariablePairs().join("&");
            if(_1c.length > 0) {
              _19 += "flashvars=\"" + _1c + "\"";
            }
            _19 += "/>";
          } else {
            if(this.getAttribute("doExpressInstall")) {
              this.addVariable("MMplayerType", "ActiveX");
              this.setAttribute("swf", this.xiSWFPath);
            }
            _19 = "<object id=\"" + this.getAttribute("id") + "\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"" + this.getAttribute("width") + "\" height=\"" + this.getAttribute("height") + "\" style=\"" + this.getAttribute("style") + "\">";
            _19 += "<param name=\"movie\" value=\"" + this.getAttribute("swf") + "\" />";
            var _1d = this.getParams();
            for(var key in _1d) {
              _19 += "<param name=\"" + key + "\" value=\"" + _1d[key] + "\" />";
            }
            var _1f = this.getVariablePairs().join("&");
            if(_1f.length > 0) {
              _19 += "<param name=\"flashvars\" value=\"" + _1f + "\" />";
            }
            _19 += "</object>";
          }
          return _19;
        },
        write: function(_20) {
          if(this.getAttribute("useExpressInstall")) {
            var _21 = new Obj.PlayerVersion([6, 0, 65]);
            if(this.installedVer.versionIsValid(_21) && !this.installedVer.versionIsValid(this.getAttribute("version"))) {
              this.setAttribute("doExpressInstall", true);
              this.addVariable("MMredirectURL", escape(this.getAttribute("xiRedirectUrl")));
              document.title = document.title.slice(0, 47) + " - Flash Player Installation";
              this.addVariable("MMdoctitle", document.title);
            }
          }
          if( this.getAttribute("doExpressInstall") || this.installedVer.versionIsValid(this.getAttribute("version"))) {
            var n = (typeof _20 == "string") ? document.getElementById(_20) : _20;
            n.innerHTML = this.getSWFHTML();
            return true;
          } else {
            if(this.getAttribute("redirectUrl") != "") {
              document.location.replace(this.getAttribute("redirectUrl"));
            }
          }
          return false;
        }
      };
      Obj.PlayerVersion = function(_29) {
        this.major = _29[0] != null ? parseInt(_29[0]) : 0;
        this.minor = _29[1] != null ? parseInt(_29[1]) : 0;
        this.rev = _29[2] != null ? parseInt(_29[2]) : 0;
      };
      Obj.SWFObjectUtil.getPlayerVersion = function() {
        var _23 = new Obj.PlayerVersion([0, 0, 0]);
        if(navigator.plugins && navigator.mimeTypes.length) {
          var x = navigator.plugins["Shockwave Flash"];
          if(x && x.description) {
            _23 = new Obj.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
          }
        } else {
          if(navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0) {
            var axo = 1;
            var _26 = 3;
            while(axo) {
              try {
                _26++;
                axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + _26);
                _23 = new Obj.PlayerVersion([_26, 0, 0]);
              } catch(e) {
                axo = null;
              }
            }
          } else {
            try {
              var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
            } catch(e) {
              try {
                var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
                _23 = new Obj.PlayerVersion([6, 0, 21]);
                axo.AllowScriptAccess = "always";
              } catch(e) {
                if(_23.major == 6) {
                  return _23;
                }
              }
              try {
                axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
              } catch(e) {}
            }
            if(axo != null) {
              _23 = new Obj.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
            }
          }
        }
        return _23;
      };
      //獲取瀏覽器flash版本號(hào)
      function getFlashVersion() {
        var version = Obj.SWFObjectUtil.getPlayerVersion();
        $("#flash_banben").html(version['major'] + "." + version['minor'] + "." + version['rev']);
      };
      //獲取操作系統(tǒng)屏幕分辨率
      function getScreenSize() {
        return {
          width: screen.width,
          height: screen.height
        };
      }
      $("#fenbianlv").html(getScreenSize().width + "*" + getScreenSize().height);
      function getNetline() {
        $('#netline').text("網(wǎng)絡(luò)已鏈接");
        window.ononline = function() {
          $('#netline').text("網(wǎng)絡(luò)已鏈接");
        };
        window.onoffline = function() {
          $('#netline').text("網(wǎng)絡(luò)已斷開");
        };
      }
      //獲取瀏覽器版本
      function getExplorerVersion() {
        var Sys = {};
        var ua = navigator.userAgent.toLowerCase();
        var s;
        var result = "";
        (s = ua.match(/qqbrowser\/([\d.]+)/)) ? Sys.qqbrowser = s[1]:
          (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
          (s = ua.match(/(trident)\/([\d.]+)/)) ? Sys.ie = '11.0' :
          (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
          (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
          (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
          (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
        if(Sys.ie)
          result = "IE " + Sys.ie;
        else if(Sys.firefox)
          result = "firefox " + Sys.firefox;
        else if(Sys.chrome)
          result = "chrome " + Sys.chrome;
        else if(Sys.opera)
          result = "opera " + Sys.opera;
        else if(Sys.safari)
          result = "safari" + Sys.safari;
        else if(Sys.qqbrowser)
          result = "QQBrowser" + Sys.qqbrowser;
        else
          result = "未知";
        $("#liulanqi").html(result + "(內(nèi)核)");
      }
      //獲取操作系統(tǒng)版本
      function getOsVersion() {
        var opName = "";
        var Name = "";
        var ua = window.navigator.userAgent;
        var isWin = (navigator.platform == "Win32") || (navigator.platform == "Windows") || (navigator.platform == "Win64");
        var isMac = (navigator.platform == "Mac68K") || (navigator.platform == "MacPPC") || (navigator.platform == "Macintosh") || (navigator.platform == "MacIntel");
        if(isMac) {
          opName = "Mac";
          Name = "Mac";
        } else if(isWin) {
          var osN = "";
          if(ua.indexOf("WOW") != -1 || ua.indexOf("Win64") != -1) {
            osN = "64";
          } else {
            osN = "32";
          }
          var osV = ua.substr(ua.indexOf("Windows NT ") + 11, 3);
          switch(osV) {
            case "5.0":
              opName = "Windows XP2000";
              Name = "Win2000";
              break;
            case "5.1":
              opName = "Windows XP ";
              Name = "WinXP";
              break;
            case "5.2":
              opName = "Windows 2003";
              Name = "Win2003";
              break;
            case "6.1":
              opName = "Windows 7 " + osN + "位";
              Name = "Win7";
              break;
            case "6.3":
              opName = "Windows 8 " + osN + "位";
              Name = "Win8";
              break;
            default:
              Name = "Other";
              break;
          }
        } else {
          var isUnix = (navigator.platform == "X11") && !isWin && !isMac;
          if(isUnix) {
            opName = "Unix";
            Name = "Unix";
          } else {
            var isLinux = (String(navigator.platform).indexOf("Linux") > -1);
            if(isLinux) {
              opName = "Linux";
              Name = "Linux";
            } else {
              Name = "Other";
            }
          }
        }
        $("#xitong").html(opName);
      }
      //獲取網(wǎng)速
      function getNet() {
        var starttime = new Date();
        var size = 0, //文件長(zhǎng)度,由腳本使用HEAD自動(dòng)計(jì)算 
          url = "2017-08-22_233329.jpg?" + new Date().valueOf(); //獲取文件的長(zhǎng)度: 
        var xhr = $.ajax({
          type: 'get', //"head",
          url: url,
          success: function(msg) {
            size = xhr.getResponseHeader('Content-Length');
            //開始GET數(shù)據(jù): 
            $.get(url, function(data) {
              var endtime = new Date();
              usetime = endtime - starttime;
              if(usetime == 0) {
                usetime = 10;
              }
              var speed = (size / (1024)) / (usetime / (1000));
              var result_text = speed.toFixed(2);
              $("#wangsu").html(result_text + "KB/S");
            });
          }
        });
      }
      getNet();
      getOsVersion();
      getExplorerVersion();
      getFlashVersion();
      getNetline();
    }());
  </script>
</html>

總結(jié)

以上所述是小編給大家介紹的JS代碼實(shí)現(xiàn)電腦配置檢測(cè)功能,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

  • Postman環(huán)境變量全局變量使用方法詳解

    Postman環(huán)境變量全局變量使用方法詳解

    這篇文章主要介紹了Postman環(huán)境變量全局變量使用方法詳解,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2020-08-08
  • 淺談js中用$(#ID)來作為選擇器的問題(id重復(fù)的時(shí)候)

    淺談js中用$(#ID)來作為選擇器的問題(id重復(fù)的時(shí)候)

    下面小編就為大家?guī)硪黄獪\談js中用$(#ID)來作為選擇器的問題(id重復(fù)的時(shí)候)。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-02-02
  • VSCode 添加自定義注釋的方法(附帶紅色警戒經(jīng)典注釋風(fēng)格)

    VSCode 添加自定義注釋的方法(附帶紅色警戒經(jīng)典注釋風(fēng)格)

    這篇文章主要介紹了VSCode 添加自定義注釋的方法(附帶紅色警戒經(jīng)典注釋風(fēng)格),本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-08-08
  • JavaScript獲取當(dāng)前cpu使用率的方法

    JavaScript獲取當(dāng)前cpu使用率的方法

    這篇文章主要介紹了JavaScript獲取當(dāng)前cpu使用率的方法,涉及JavaScript針對(duì)系統(tǒng)硬件操作的相關(guān)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下
    2015-12-12
  • JAVASCRIPT實(shí)現(xiàn)的WEB頁(yè)面跳轉(zhuǎn)以及頁(yè)面間傳值方法

    JAVASCRIPT實(shí)現(xiàn)的WEB頁(yè)面跳轉(zhuǎn)以及頁(yè)面間傳值方法

    在WEB頁(yè)面中,我們實(shí)現(xiàn)頁(yè)面跳轉(zhuǎn)的方法通常是用LINK,BUTTON LINK ,IMG LINK等等,由用戶點(diǎn)擊某處,然后直接由瀏覽器幫我們跳轉(zhuǎn)。
    2010-05-05
  • javascript數(shù)組去重方法終極總結(jié)

    javascript數(shù)組去重方法終極總結(jié)

    這篇文章主要介紹了javascript數(shù)組去重終極總結(jié),本文列舉了3種javascript數(shù)組去重方法,并分別分析了它們的優(yōu)缺點(diǎn),需要的朋友可以參考下
    2014-06-06
  • 利用d3.js力導(dǎo)布局繪制資源拓?fù)鋱D實(shí)例教程

    利用d3.js力導(dǎo)布局繪制資源拓?fù)鋱D實(shí)例教程

    這篇文章主要給大家介紹了關(guān)于如何利用d3.js力導(dǎo)布局繪制資源拓?fù)鋱D的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-01-01
  • JavaScript訪問CSS屬性的幾種方式介紹

    JavaScript訪問CSS屬性的幾種方式介紹

    要通過元素訪問樣式表,那么就應(yīng)該先確定是哪個(gè)元素。直接訪問樣式表在該樣式塊里找相應(yīng)的樣式規(guī)則,最后在該樣式規(guī)則里找相應(yīng)的樣式
    2014-07-07
  • javascript垃圾收集機(jī)制的原理分析

    javascript垃圾收集機(jī)制的原理分析

    javascript具有自動(dòng)垃圾收集機(jī)制,執(zhí)行環(huán)境會(huì)負(fù)責(zé)管理代碼執(zhí)行過程中使用的內(nèi)存。在編寫javascript程序時(shí),開發(fā)人員不用再關(guān)心內(nèi)存使用問題,所需內(nèi)存的分配以及無用內(nèi)存的回收完全實(shí)現(xiàn)了自動(dòng)管理。本文將詳細(xì)介紹javascript的垃圾收集機(jī)制
    2016-12-12
  • 使用clipboard.js庫(kù)實(shí)現(xiàn)復(fù)制剪切功能

    使用clipboard.js庫(kù)實(shí)現(xiàn)復(fù)制剪切功能

    這篇文章介紹了clipboard.js實(shí)現(xiàn)復(fù)制功能的方法,文中通過示例代碼介紹的非常詳細(xì)。對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2022-06-06

最新評(píng)論