Created
February 17, 2019 14:01
-
-
Save NightStrang6r/a0740b3aa9659bfeac3d5d6c80a2f8de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function MonitoringJS(){ | |
console.log('>>Monitoring.js loaded.'); | |
function getCookie(name) { | |
var matches = document.cookie.match(new RegExp( | |
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)" | |
)); | |
return matches ? decodeURIComponent(matches[1]) : undefined; | |
} | |
var reqLink = "http://leoltd.zzz.com.ua/script/monitoring/monitoring.php?"; | |
var loc = window.location; | |
var body = "location=" + loc; | |
if(getCookie('MonitoringJS') == "1"){ | |
body = body + "&alreadywas=1"; | |
console.log('>>Monitoring.js: User already was on this site.'); | |
} | |
document.cookie = "MonitoringJS=1"; | |
var request = new XMLHttpRequest(); | |
function reqReadyStateChange() { | |
if (request.readyState == 4) { | |
var status = request.status; | |
if (status == 200) { | |
document.getElementById("output").innerHTML=request.responseText; | |
} | |
} | |
} | |
request.open("GET", reqLink + body); | |
request.onreadystatechange = reqReadyStateChange; | |
request.send(); | |
console.log('>>Monitoring.js: Request was send.'); | |
} | |
MonitoringJS(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment