/*** @author hechen*/var gs = {/** 화면 너비 가져 오기 **/screenwidth : function () {return swooling.screen.width; }, / *** 화면 높이를 가져옵니다 ** / ScreenHeight : function () {return Window.Screen.height; }, / ** 브라우저 받기 *** / 브라우지 : 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"); (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"을 반환합니다. } "기타"를 반환합니다. }, / **** 클라이언트 id **** / clientId : function (name) {var cookies = docum var value = ""; for (var i = 0; i <cookies.length; i ++) {var temp = 쿠키 [i] .split ( "="); var tempvalue = temp [0] .replace (/(^/s*) | (/s*$)/g, ""); if (tempValue == name) {value = unescape (temp [1]); 부서지다; }} 반환 값; }, / **** 제품 id **** / searchGID : function () {var url = window.location.href; var value = ""; 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);}); } 반환 값; }, / **** 사이트 검색 키워드를 가져옵니다. **** / searchKey : function () {var url = window.location.href; var value = ""; if (url! = undefined && url! = "") {url.replace (/== ]*/, function (a, b, c) {if (a! = undefined && a! = "&& a.length> 1) {value = a.substring (1);}}); } 반환 값; }, / ** 제품 카테고리 검색 번호 가져 오기 ** / SearchCategory : function () {var url = window.location.href; var value = ""; if (url! = undefined && url! = "") {url.replace (/-/d+/, function (a, b, c) {if (a! = undefined && a! = "&& a.length> 1) {value = a.substring (1);}}); } 반환 값; }, / **** 오프 사이트 검색 Google Baidu ***** / SearchSite : function (type) {var referrer = document.referrer; if (참조자! = undefined && referrer! = "" ") {if ("google "== type) {url.replace (new regexp ("(? :^|/? | &) q = ([^|/]*)*) (? : & | $) "), 기능 (a, b, c) {if (this. A.Substring ( "=") + 1, a.length}; } else if ( "baidu"== type) {url.replace (new regexp ( "(? :^| |/? | | | | &) wd = ([^&]*) (? : & | $)"), function (a, b, c) {if (this._ch! = undefined && a! = undefined && a.length> 0) {a. A.length -1); } else if ( "sogou"== type) {url.replace (new regexp ( "(? :^| |/? | | &) query = ([^&]*) (? : & | $)"), function (a, b, c) {if (this._ch! = undefined && a.length> 0) {a. A.length -1); } else if ( "bing"== type) {url.replace (new regexp ( "(? :^| |/? | | &) q = ([^&]*) (? : & | $)"), function (a, b, c) {if (this._ch! = undefined && = unfefined && a. A.length -1); } } 반품 ""; . }}, / *** 사용자 정의 매개 변수 ** / param : function (value) {if (this._ch! = undefined) {this._ch [ "_ ps"] = value; }},/*********** 배경에 데이터 제출 ***********/postdata : function () {$ .ajax ({url : "http : // localhost : 28482/ajax/statactions.aspx? }, /*** 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]). test (hosturl)) {this._ch [ "_ key"] = this.searchkey (); } this._ch [ "_ tu"] = hosturl; } var referrer = document.referrer; if (참조자! = undefined && referrer! = "" ") {if ((new regexp (this._reg [0]). 테스트 (참조)) {this._ch ["_ key "] = this.searchsite ("google "); } else if ((new regexp (this._reg [1]). 테스트 (참조 자)) {this._ch [ "_ key"] = this.searchsite ( "baidu"); } else if ((new regexp (this._reg [2]). 테스트 (참조 자)) {this._ch [ "_ key"] = this.searchsite ( "sogou"); } else if ((new regexp (this._reg [3]). 테스트 (참조 자)) {this._ch [ "_ key"] = this.searchsite ( "bing"); } this._ch [ "_ su"] = 참조자; } // 클라이언트 관련 정보 가져 오기 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 Code Style Guide"를 확인하십시오. 또한 모두가 wulin.com을 더 지원하기를 바랍니다.