/*** @Author Hechen*/var gs = {/** Bildschirmbreite **/screenwidth: function () {return window.screen.width; }, / *** Bildschirmhöhe erhalten ** / screenHeight: function () {return window.screen.height; }, / ** browser *** / browse: function () {var browser = {}; var userAgent = navigator.useragent.tolowerCase (); var S; (s = userAgent.match (/msie ([/d. weibliche+)/)? browser.ie = s [1]: (s = userAgent.match (/firefox // ([/d.]+)/))? browser.firefox = s [1]: (s = userAgent.match (/chrome // ([/d.]+)/))? browser.chrome = s [1]: (s = userAgent.match (/Opera. ([/d.]+)/))? browser.opera = s [1]: (s = userAgent.match (/Version // ([/d.]+).*Safari/))? browser.safari = s [1]: 0; var Version = ""; if (browser.ie) {Version = 'ie' + browser.ie; } else {if (browser.firefox) {Version = 'Firefox' + browser.firefox; } else {if (browser.chrome) {Version = 'Chrome' + browser.chrome; } else {if (browser.opera) {Version = 'Opera' + browser.opera; } else {if (browser.safari) {Version = 'safari' + browser.safari; } else {Version = 'unbekanntes Browser'; }}}} Rückgabeversion; }, / ** das Betriebssystem *** / clientos: function () {var suseragent = navigator.useragent; var iswin = (navigator.platform == "Win32") || (Navigator.Platform == "Windows"); var ismac = (navigator.Platform == "mac68k") || (Navigator.Platform == "macppc") || (Navigator.Platform == "Macintosh") || (Navigator.Platform == "MacinTel"); Wenn (ismac) "mac" zurückgibt; var isunix = (navigator.platform == "x11") &&! iswin &&! ismac; wenn (isunix) zurück "unix"; var isLinux = (String (navigator.Platform) .Indexof ("Linux")> -1); Wenn (isLinux) "Linux" zurückgibt; if (iswin) {var iswin2k = suseragent.indexof ("Windows NT 5.0")> -1 || suseragent.indexof ("Windows 2000")> -1; if (iswin2k) return "Win2000"; var iswinxp = suseragent.indexof ("Windows NT 5.1")> -1 || suseragent.indexof ("Windows XP")> -1; if (iswinxp) return "winxp"; var iswin2003 = suseragent.indexof ("Windows NT 5.2")> -1 || suseragent.indexof ("Windows NT 5.2")> -1; if (iswin2003) return "Win2003"; var iswinvista = suseragent.indexof ("Windows NT 6.0")> -1 || Suseragent.Indexof ("Windows Vista")> -1; wenn (iswinvista) zurück "Winvista"; var iswin7 = suseragent.indexof ("Windows NT 6.1")> -1 || Suseragent.Indexof ("Windows 7")> -1; wenn (iswin7) zurück "win7"; } return "other"; }, / **** client id **** / clientID: function (name) {var cookies = document.cookie.split (";"); var value = ""; für (var i = 0; i <cookies.length; i ++) {var temp = cookies [i] .Split ("="); var tempValue = temp [0] .Replace (/(^/s*) | (/s*$)/g, ""); if (tempValue == name) {value = unescape (temp [1]); brechen; }} Rückgabewert; }, / **** Produkt -ID **** / searchGid: function () {var url = window.location.href; var value = ""; if (url! = undefined && url! = "") {url.replace (/-/d+-/, function (a, b, c) {if (a! } Rückgabewert; }, / **** das Keyword von Site -Suchern **** / SearchKey: function () {var url = window.location.href; var value = ""; if (url! = undefined && url! } Rückgabewert; }, / ** Produktkategorie -Suchnummer ** / SearchCategory: function () {var url = window.location.href; var value = ""; if (url! = undefined && url! } Rückgabewert; }, / **** Off-Site-Suche Google Baidu ***** / SearchSite: Funktion (Typ) {var referrer = document.Referrer; if (referrer! = undefined && referrer! A.Substring (A.Indexof ("=") + 1, A.Length - 1); } else if ("baidu" == Typ) {url.replace (neuer regexp ("(?:^|/? | &) wd = ([^&]*) (?: & | $)"), Funktion (a, b, c) {if (this._ch! 1, A.Length - 1); } else if ("SOGOU" == Typ) {url.replace (neuer regexp ("(?:^|/? | &) query = ([^&]*) (?: & | $)"), Funktion (a, b, c) {if (this._ch! 1, A.Length - 1); } else if ("Bing" == Typ) {url.replace (neuer regexp ("(?:^|/? | &) q = ([^&]*) (?: & | $)"), Funktion (a, b, c) {if (this._ch! A.Length - 1); } } zurückkehren ""; }. }}, / *** benutzerdefinierte Parameter ** / param: function (value) {if (this._ch! = Undefined) {this._ch ["_ ps"] = value; }}. }, /*** init: function () {if (this._ch! = Undefined) {this._ch = undefiniert; } this._ch = {}; if (this.reg! = undefiniert) {this._reg = undefiniert; } // Initialisieren Sie den regulären Ausdruck, der URL entspricht. this.reg [0] = "http://www.google.com.hk (.*)"; this._reg [1] = "http://www.baidu.com (.*)"; this._reg [2] = "http://www.sogou.com (.*)"; this._reg [3] = "http://cn.bing.com (.*)"; // URL -Parameter analysieren var hosturl = window.location.href; if (hosturl! = undefined && hosturl! } else if ((neuer regexp (this._reg [7])). test (hosturl)) {} else if ((neuer regexp (this._reg [5])). } else if ((neuer regexp (this._reg [5])). test (hosturl)) {this._ch ["_ cid"] = this.searchCategory (); } else if ((neuer regexp (this._reg [5])). test (hosturl)) {this._ch ["_ cid"] = this.searchCategory (); } else if ((neu) regexp (this.reg [6])). test (hosturl)) {this._ch ["_ key"] = this.searchKey (); } this._ch ["_ tu"] = hosturl; } var referrer = document.referrer; if (referrer! = undefined && referrer! } else if ((neuer regexp (this._reg [1])). test (referrer)) {this._ch ["_ key"] = this.searchSite ("baidu"); } else if ((neuer regexp (this._reg [2])). test (referrer)) {this._ch ["_ key"] = this.searchSite ("SOGOU"); } else if ((neuer regexp (this._reg [3])). test (referrer)) {this._ch ["_ key"] = this.searchSite ("Bing"); } this._ch ["_ su"] = referrer; } // Client-bezogene Informationen that._ch ["_ sw"] = this.screenwidth (); this._ch ["_ sh"] = this.screenHeight (); this._ch ["_ bw"] = this.browse (); this._ch ["_ cs"] = this.clientos (); this._ch ["_ Mid"] = this.clientid ("from_channelid"); this._ch ["_ ctid"] = this.clientid ("clientKey"); }, _ch: undefiniert, _reg: undefiniertDas obige ist der gesamte Inhalt dieses Artikels. Weitere Informationen zu JavaScript finden Sie unter: "JavaScript Reference Tutorial" und "JavaScript Code Style Guide". Ich hoffe auch, dass jeder wulin.com mehr unterstützt.