/*** @author hechen*/var gs = {/** get screen width **/screenWidth:function(){return window.screen.width; }、 / ***スクリーンの高さを取得** / screenheight:function(){return window.screen.height; }、 / ** browser *** / browse:function(){var browser = {}; var useragent = navigator.useragent.tolowercase(); var s; (s = useragent.match(/msie([/d.]+))? 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 = '不明なブラウザー'; }}}} returnバージョン; }、 / **オペレーティングシステムを取得*** / 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"); if(ismac) "mac"を返します。 var isunix =(navigator.platform == "x11")&&!iswin &&!ismac; if(isunix) "unix"を返します。 var islinux =(string(navigator.platform).indexof( "linux")> -1); if(islinux) "linux"を返します。 if(iswin){var iswin2k = suseragent.indexof( "windows nt 5.0")> -1 || suseragent.indexof( "Windows 2000")> -1; if(iswin2k) "win2000"を返します。 var iswinxp = suseragent.indexof( "windows nt 5.1")> -1 || suseragent.indexof( "windows xp")> -1; if(iswinxp) "winxp"を返します。 var iswin2003 = suseragent.indexof( "Windows NT 5.2")> -1 || suseragent.indexof( "Windows NT 5.2")> -1; if(iswin2003) "win2003"を返します。 var iswinvista = suseragent.indexof( "windows nt 6.0")> -1 || suseragent.indexof( "Windows Vista")> -1; if(iswinvista) "winvista"を返します。 var iswin7 = suseragent.indexof( "windows nt 6.1")> -1 || suseragent.indexof( "Windows 7")> -1; if(iswin7)を「win7」を返します。 }「その他」を返します。 }、 / **** get client id **** / clientId:function(name){var cookies = document.cookie.split( ";"); var値= ""; for(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]);壊す; }} return値; }、 / ****製品IDを取得**** / searchGid:function(){var url = window.location.href; var値= ""; if(url!= undefined && url!= ""){url.replace(/ - /d+ - /、function(a、b、c){if(a!= undefined && a!= "" "&& a.length> 2){value = a.substring(1、a.length-1);}}); } return値; }、 / ****サイト検索キーワードを取得**** / searchKey:function(){var url = window.location.href; var値= ""; if(url!= undefined && url!= ""){url.Replace(/[=] .*/、function(a、b、c){if(a!= undefined && a!= "" "&& a.length> 1){value = a.substring(1);}}); } return値; }、 / **製品カテゴリ検索番号を取得** / searchCategory:function(){var url = window.location.href; var値= ""; if(url!= undefined && url!= ""){url.replace(/ - /d+/、function(a、b、c){if(a!= undefined && a!= "" "&& a.length> 1){value = a.substring(1);}}); } return値; }、 / ****オフサイト検索Google Baidu ***** / searchSite:function(type){var referrer = document.referrer; if(referrer!= undefined && referrer!= ""){if( "google" == type){url.replace(new regexp( "(?:^|/?|&)q =([^&]*)(?:&| $)")、function(a、b、c){if(this._ch!= redefined && a. A.Substring( "=") + 1、a.length -1); } else if( "baidu" == type){url.Replace(new regexp( "(?:^|/?|&&)wd =([^&]*)(?:&| $)")、function(a、b、c){if(this._ch!= undefined&&a 1、a.length -1); } else if( "sogou" == type){url.Replace(new regexp( "(?:^|/?|&)query =([^&]*)(?:&| $)")、function(a、b、c){if(this._ch!= undefined&&&a 1、a.length -1); } else if( "bing" == type){url.Replace(new regexp( "(?:^|/?|&)q =([^&]*)(?:&| $)")、function(a、b、c){if(this._ch!= undefined && a!= undefine a.length -1); } } 戻る ""; }、 / *******値を配列に挿入します************* / pushValue:function(key、value){if(this._ch!= undefined){this._ch [key] = value; }}、 / ***カスタムパラメーター** / param:function(value){if(this._ch!= undefined){this._ch ["_ ps"] = value; }}、/*********データを背景に提出します**********/postdata:function(){$ .ajax({url: "http:// localhost:28482/ajax/statoctions.aspx?t =" + math.random()、type: "post:"、data:_ch、success:success: }、 /*** init:function(){if(this._ch!= undefined){this._ch = undefined; } this._ch = {}; if(this._reg!= undefined){this._reg = undefined; } // url this._reg = new Array()に一致する正規式を初期化します。 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パラメーターを分析するvar hosturl = window.location.href; if(hosturl!= undefined && hosturl!= ""){if((new regexp(this._reg [4]))。test(hosturl)){this._ch ["_ gid"] = this.searchgid(); } else if((new regexp(this._reg [7]))。test(hosturl)){} else if((new regexp(this._reg [5]))。test(hosturl)){this._ch ["_ cid"] = this.searchcategory(); } else if((new regexp(this._reg [5]))。test(hosturl)){this._ch ["_ cid"] = this.searchcategory(); } else if((new regexp(this._reg [5]))。test(hosturl)){this._ch ["_ cid"] = this.searchcategory(); } else if((new)regexp(this._reg [6])) } this._ch ["_ tu"] = hosturl; } var referrer = document.referrer; if(referrer!= undefined && referrer!= ""){if((new regexp(this._reg [0]))。test(referrer)){this._ch ["_ key"] = this.searchsite( "google"); } else if((new regexp(this._reg [1]))。test(referrer)){this._ch ["_ key"] = this.searchsite( "baidu"); } else if((new regexp(this._reg [2]))。test(referrer)){this._ch ["_ key"] = this.searchSite( "sogou"); } else if((new regexp(this._reg [3]))。test(referrer)){this._ch ["_ key"] = this.searchSite( "bing"); } this._ch ["_ su"] = referer; } //クライアント関連情報を取得this._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:未定義、_reg:未定義上記は、この記事のコンテンツ全体です。 JavaScriptの詳細については、「JavaScriptリファレンスチュートリアル」と「JavaScriptコードスタイルガイド」をご覧ください。また、誰もがwulin.comをもっとサポートすることを願っています。