From eedbbc757c1df7eff1c775e1599daa86e15439ef Mon Sep 17 00:00:00 2001 From: JulioV Date: Wed, 18 Nov 2020 18:41:48 -0500 Subject: [PATCH] Second banner test --- docs/javascripts/extra.js | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/docs/javascripts/extra.js b/docs/javascripts/extra.js index 6bf97374..22f56f2f 100644 --- a/docs/javascripts/extra.js +++ b/docs/javascripts/extra.js @@ -1,12 +1,18 @@ -xhr.onload = function() { - var versions = JSON.parse(this.responseText); - - var realVersion = versions.find(function(i) { - return i.version === CURRENT_VERSION || - i.aliases.includes(CURRENT_VERSION); - }).version; - console.log(realVersion) - console.log(CURRENT_VERSION) -} +window.addEventListener("DOMContentLoaded", function() { + + var xhr = new XMLHttpRequest(); + xhr.open("GET", window.location + "../versions.json"); + xhr.onload = function() { + var versions = JSON.parse(this.responseText); + + var realVersion = versions.find(function(i) { + return i.version === CURRENT_VERSION || + i.aliases.includes(CURRENT_VERSION); + }).version; -console.log("hi") \ No newline at end of file + console.log(version) + console.log(CURRENT_VERSION) + }; + xhr.send(); + }); + \ No newline at end of file