From e3b292a7559b6ae5dccfffa174decec950cb76ee Mon Sep 17 00:00:00 2001 From: MattTheTekie Date: Fri, 24 Apr 2026 11:48:12 -0400 Subject: [PATCH] chore: fixes --- javascript/view-counter-legacy.js | 26 ++++++++++++++++++++++++++ legacy.html | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 javascript/view-counter-legacy.js diff --git a/javascript/view-counter-legacy.js b/javascript/view-counter-legacy.js new file mode 100644 index 0000000..389f0d4 --- /dev/null +++ b/javascript/view-counter-legacy.js @@ -0,0 +1,26 @@ +const VISITOR_COUNTER = document.getElementById("visitorCounter"); + +let xhttp = new XMLHttpRequest(); +xhttp.onreadystatechange = function () { + if (this.readyState == 4 && this.status == 200) { + // Get the data + let site_data = JSON.parse(this.responseText); + // Add commas + let num_arr = site_data.info.views.toString().split(""); + let num_str = ""; + for (i = 0; i < num_arr.length; i++) { + num_str += num_arr[i]; + if ((num_arr.length - 1 - i) % 3 == 0 && num_arr.length - 1 - i != 0) { + num_str += ","; + } + } + // Add result to html + VISITOR_COUNTER.innerHTML = num_str; + } +}; +xhttp.open( + "GET", + "http://www.veltron.net/counter.php?sitename=venith", + true +); +xhttp.send(); diff --git a/legacy.html b/legacy.html index 767f2fe..0ed9927 100644 --- a/legacy.html +++ b/legacy.html @@ -93,7 +93,7 @@ - +