diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2023-09-24 23:34:58 +0200 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2023-09-24 23:34:58 +0200 |
commit | 70b83bcb1848aa8de5533f409a36ec5ceab72dae (patch) | |
tree | e7029c313b0e1b6aa60c06360f9593a520ca5253 | |
parent | d0668e9bf1e8e1d0238cf1b01e83ff24df47e2cb (diff) |
js: Don't use jquery.
-rw-r--r-- | static/js/deobfuscate.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/static/js/deobfuscate.js b/static/js/deobfuscate.js index ef8d60b..498dade 100644 --- a/static/js/deobfuscate.js +++ b/static/js/deobfuscate.js @@ -1,9 +1,10 @@ var deobfuscate = function(s) { return s.split('').map(function(n){return String.fromCharCode(n.charCodeAt(0)-1);}).join(''); }; -$(document).ready(function() { - $('.obfuscated').each(function() { - var fixed = deobfuscate( $(this).text() ); - $(this).text(fixed); - }); +document.addEventListener('DOMContentLoaded', function() { + const obfuscated = document.querySelectorAll('.obfuscated'); + obfuscated.forEach((el) => { + var fixed = deobfuscate(el.innerHTML); + el.innerHTML = fixed; + }); }); |