자바스크립트로 구현된 웹사이트 트래픽 통계 코드
웹사이트에는 일반적으로 효율적이고 실용적인 도구가 많이 있으며 매우 정확합니다. 실용적인 JavaScript는 인터넷에서 일반적으로 사용되는 것만큼 정확하지는 않지만, 특정 기능을 구현하기만 하면 됩니다. 관심 있는 친구들은 다음을 참조하세요. 더 이상 고민하지 않고 js 코드를 게시하겠습니다.
<script type="text/javascript"> /** * vlstat 浏览器统计脚本 */ var statIdName = "vlstatId"; var xmlHttp; /** * 设置cookieId */ function setCookie(c_name, value, expiredays) { var exdate = new Date(); exdate.setDate(exdate.getDate() + expiredays); document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString()) + ";path=/;domain=cecb2b.com"; } /** * 获取cookieId */ function getCookie(c_name) { if (document.cookie.length > 0) { c_start = document.cookie.indexOf(c_name + "="); if (c_start != -1) { c_start = c_start + c_name.length + 1; c_end = document.cookie.indexOf(";", c_start); if (c_end == -1) { c_end = document.cookie.length; } return unescape(document.cookie.substring(c_start, c_end)); } } return ""; } /** * 获取当前时间戳 */ function getTimestamp() { var timestamp = Date.parse(new Date()); return timestamp; } /** * 生成statId */ function genStatId() { var cookieId = getTimestamp(); cookieId = "vlstat" + "-" + cookieId + "-" + Math.round(Math.random() * 3000000000); return cookieId; } /** * 设置StatId */ function setStatId() { var cookieId = genStatId(); setCookie(statIdName, cookieId, 365); } /** * 获取StatId */ function getStatId() { var statId = getCookie(statIdName); if (statId != null && statId.length > 0) { return statId; } else { setStatId(); return getStatId(); } } /** * 获取UA */ function getUA() { var ua = navigator.userAgent; if (ua.length > 250) { ua = ua.substring(0, 250); } return ua; } /** * 获取浏览器类型 */ function getBrower() { var ua = getUA(); if (ua.indexOf("Maxthon") != -1) { return "Maxthon"; } else if (ua.indexOf("MSIE") != -1) { return "MSIE"; } else if (ua.indexOf("Firefox") != -1) { return "Firefox"; } else if (ua.indexOf("Chrome") != -1) { return "Chrome"; } else if (ua.indexOf("Opera") != -1) { return "Opera"; } else if (ua.indexOf("Safari") != -1) { return "Safari"; } else { return "ot"; } } /** * 获取浏览器语言 */ function getBrowerLanguage() { var.browserLanguage; return lang != null && lang.length > 0 ? lang : ""; } /** * 获取操作系统 */ function getPlatform() { return navigator.platform; } /** * 获取页面title */ function getPageTitle() { return document.title; } /** * 创建一个form * * @return */ function createSubmitForm() { var frm = document.createElement("form"); document.body.appendChild(frm); frm.method = "POST"; return frm; } /** * 为form创建一个元素 * * @param inputForm * @param elementName * @param elementValue * @return */ function createFormElement(frmInput, elementName, elementValue) { var element = document.createElement("input"); element.setAttribute("id", elementName); element.setAttribute("name", elementName); element.setAttribute("type", "hidden"); element.setAttribute("value", elementValue); frmInput.appendChild(element); return element; } /** * 构造XMLHttpRequest对象 * * @return */ function createXMLHttpRequest() { if (window.ActiveXObject) { xmlHttp = new ActiveXObject('Microsoft.XMLHTTP'); } else if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } } /** * url指定跳转页,data是要post的数据。func类似于函数指针 * * @param url * @param data * @param func * @return */ function AjaxPost(url, data, func) { var httpRequest = createHttpRequest(); if (httpRequest) { httpRequest.open("POST", url, true); httpRequest.setRequestHeader("content-length", data.length); httpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); httpRequest.send(data); httpRequest.onreadystatechange = function() { if (httpRequest.readyState == 4) { try { if (httpRequest.status == 200) { if (func) { // 这里可以调用想要的函数 func(httpRequest.responseText); } } } catch (e) { alert("Error XMLHttpRequest!"); } } } } else { alert("Error initializing XMLHttpRequest!"); } } function vlstatInitLE(vlch, vlch1, vlch2, vlch3) { var p; var vlstatCH = vlch != null && vlch.length > 0 ? vlch : ""; var vlstatCH1 = vlch1 != null && vlch1.length > 0 ? vlch1 : ""; var vlstatCH2 = vlch2 != null && vlch2.length > 0 ? vlch2 : ""; var vlstatCH3 = vlch3 != null && vlch3.length > 0 ? vlch3 : ""; var vlstatCookieId = getStatId(); var vlstatUA = encodeURIComponent(getUA()); var vlstatIPAddress = document.localName; var vlstatREFURL = encodeURIComponent(document.referrer); var vlstatURL = encodeURIComponent(document.URL); var vlstatScreenX = screen.width; var vlstatScreenY = screen.height; var vlstatOS = getPlatform(); var vlstatBrower = getBrower(); var vlstatBrowerLanguage = getBrowerLanguage(); var vlstatPageTitle = encodeURIComponent(getPageTitle()); var vlstatAction = "index.php"; p = "cookieId=" + vlstatCookieId + "&ua=" + vlstatUA + "&ip=" + vlstatIPAddress + "&refurl=" + vlstatREFURL + "&url=" + vlstatURL + "&screenX=" + vlstatScreenX + "&screenY=" + vlstatScreenY + "&os=" + vlstatOS + "&brower=" + vlstatBrower + "&browerLang=" + vlstatBrowerLanguage + "&title=" + vlstatPageTitle + "&ch=" + vlstatCH + "&ch1=" + vlstatCH1 + "&ch2=" + vlstatCH2 + "&ch3=" + vlstatCH3; var urlGo = vlstatAction + "?" + p; createXMLHttpRequest(); xmlHttp.open('GET', urlGo); xmlHttp.send(null); } </script>
/** * vlstat 浏览器统计脚本 */ var statIdName = "vlstatId"; var xmlHttp; /** * 设置cookieId */ function setCookie(c_name, value, expiredays) { var exdate = new Date(); exdate.setDate(exdate.getDate() + expiredays); document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString()) + ";path=/;domain=cecb2b.com"; } /** * 获取cookieId */ function getCookie(c_name) { if (document.cookie.length > 0) { c_start = document.cookie.indexOf(c_name + "="); if (c_start != -1) { c_start = c_start + c_name.length + 1; c_end = document.cookie.indexOf(";", c_start); if (c_end == -1) { c_end = document.cookie.length; } return unescape(document.cookie.substring(c_start, c_end)); } } return ""; } /** * 获取当前时间戳 */ function getTimestamp() { var timestamp = Date.parse(new Date()); return timestamp; } /** * 生成statId */ function genStatId() { var cookieId = getTimestamp(); cookieId = "vlstat" + "-" + cookieId + "-" + Math.round(Math.random() * 3000000000); return cookieId; } /** * 设置StatId */ function setStatId() { var cookieId = genStatId(); setCookie(statIdName, cookieId, 365); } /** * 获取StatId */ function getStatId() { var statId = getCookie(statIdName); if (statId != null && statId.length > 0) { return statId; } else { setStatId(); return getStatId(); } } /** * 获取UA */ function getUA() { var ua = navigator.userAgent; if (ua.length > 250) { ua = ua.substring(0, 250); } return ua; } /** * 获取浏览器类型 */ function getBrower() { var ua = getUA(); if (ua.indexOf("Maxthon") != -1) { return "Maxthon"; } else if (ua.indexOf("MSIE") != -1) { return "MSIE"; } else if (ua.indexOf("Firefox") != -1) { return "Firefox"; } else if (ua.indexOf("Chrome") != -1) { return "Chrome"; } else if (ua.indexOf("Opera") != -1) { return "Opera"; } else if (ua.indexOf("Safari") != -1) { return "Safari"; } else { return "ot"; } } /** * 获取浏览器语言 */ function getBrowerLanguage() { var.browserLanguage; return lang != null && lang.length > 0 ? lang : ""; } /** * 获取操作系统 */ function getPlatform() { return navigator.platform; } /** * 获取页面title */ function getPageTitle() { return document.title; } /** * 创建一个form * * @return */ function createSubmitForm() { var frm = document.createElement("form"); document.body.appendChild(frm); frm.method = "POST"; return frm; } /** * 为form创建一个元素 * * @param inputForm * @param elementName * @param elementValue * @return */ function createFormElement(frmInput, elementName, elementValue) { var element = document.createElement("input"); element.setAttribute("id", elementName); element.setAttribute("name", elementName); element.setAttribute("type", "hidden"); element.setAttribute("value", elementValue); frmInput.appendChild(element); return element; } /** * 构造XMLHttpRequest对象 * * @return */ function createXMLHttpRequest() { if (window.ActiveXObject) { xmlHttp = new ActiveXObject('Microsoft.XMLHTTP'); } else if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } } /** * url指定跳转页,data是要post的数据。func类似于函数指针 * * @param url * @param data * @param func * @return */ function AjaxPost(url, data, func) { var httpRequest = createHttpRequest(); if (httpRequest) { httpRequest.open("POST", url, true); httpRequest.setRequestHeader("content-length", data.length); httpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); httpRequest.send(data); httpRequest.onreadystatechange = function() { if (httpRequest.readyState == 4) { try { if (httpRequest.status == 200) { if (func) { // 这里可以调用想要的函数 func(httpRequest.responseText); } } } catch (e) { alert("Error XMLHttpRequest!"); } } } } else { alert("Error initializing XMLHttpRequest!"); } } function vlstatInitLE(vlch, vlch1, vlch2, vlch3) { var p; var vlstatCH = vlch != null && vlch.length > 0 ? vlch : ""; var vlstatCH1 = vlch1 != null && vlch1.length > 0 ? vlch1 : ""; var vlstatCH2 = vlch2 != null && vlch2.length > 0 ? vlch2 : ""; var vlstatCH3 = vlch3 != null && vlch3.length > 0 ? vlch3 : ""; var vlstatCookieId = getStatId(); var vlstatUA = encodeURIComponent(getUA()); var vlstatIPAddress = document.localName; var vlstatREFURL = encodeURIComponent(document.referrer); var vlstatURL = encodeURIComponent(document.URL); var vlstatScreenX = screen.width; var vlstatScreenY = screen.height; var vlstatOS = getPlatform(); var vlstatBrower = getBrower(); var vlstatBrowerLanguage = getBrowerLanguage(); var vlstatPageTitle = encodeURIComponent(getPageTitle()); var vlstatAction = "index.php"; p = "cookieId=" + vlstatCookieId + "&ua=" + vlstatUA + "&ip=" + vlstatIPAddress + "&refurl=" + vlstatREFURL + "&url=" + vlstatURL + "&screenX=" + vlstatScreenX + "&screenY=" + vlstatScreenY + "&os=" + vlstatOS + "&brower=" + vlstatBrower + "&browerLang=" + vlstatBrowerLanguage + "&title=" + vlstatPageTitle + "&ch=" + vlstatCH + "&ch1=" + vlstatCH1 + "&ch2=" + vlstatCH2 + "&ch3=" + vlstatCH3; var urlGo = vlstatAction + "?" + p; createXMLHttpRequest(); xmlHttp.open('GET', urlGo); xmlHttp.send(null); }

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제











기사는 JavaScript 라이브러리 작성, 게시 및 유지 관리, 계획, 개발, 테스트, 문서 및 홍보 전략에 중점을 둡니다.

이 기사는 브라우저에서 JavaScript 성능을 최적화하기위한 전략에 대해 설명하고 실행 시간을 줄이고 페이지로드 속도에 미치는 영향을 최소화하는 데 중점을 둡니다.

프론트 엔드 개발시 프론트 엔드 열지대 티켓 인쇄를위한 자주 묻는 질문과 솔루션, 티켓 인쇄는 일반적인 요구 사항입니다. 그러나 많은 개발자들이 구현하고 있습니다 ...

이 기사는 브라우저 개발자 도구를 사용하여 효과적인 JavaScript 디버깅, 중단 점 설정, 콘솔 사용 및 성능 분석에 중점을 둡니다.

기술 및 산업 요구에 따라 Python 및 JavaScript 개발자에 대한 절대 급여는 없습니다. 1. 파이썬은 데이터 과학 및 기계 학습에서 더 많은 비용을 지불 할 수 있습니다. 2. JavaScript는 프론트 엔드 및 풀 스택 개발에 큰 수요가 있으며 급여도 상당합니다. 3. 영향 요인에는 경험, 지리적 위치, 회사 규모 및 특정 기술이 포함됩니다.

이 기사는 소스 맵을 사용하여 원래 코드에 다시 매핑하여 미니어링 된 JavaScript를 디버그하는 방법을 설명합니다. 소스 맵 활성화, 브레이크 포인트 설정 및 Chrome Devtools 및 Webpack과 같은 도구 사용에 대해 설명합니다.

Console.log 출력의 차이의 근본 원인에 대한 심층적 인 논의. 이 기사에서는 Console.log 함수의 출력 결과의 차이점을 코드에서 분석하고 그에 따른 이유를 설명합니다. � ...

동일한 ID로 배열 요소를 JavaScript의 하나의 객체로 병합하는 방법은 무엇입니까? 데이터를 처리 할 때 종종 동일한 ID를 가질 필요가 있습니다 ...
