encodeURIComponent is how we spell escape in this century from thinegen
Ted Unangst tedu@tedunangst.com
Wed, 04 Jan 2023 13:51:07 -0500
2 files changed,
2 insertions(+),
2 deletions(-)
M
views/honkpage.js
→
views/honkpage.js
@@ -2,7 +2,7 @@ function encode(hash) {
var s = [] for (var key in hash) { var val = hash[key] - s.push(escape(key) + "=" + escape(val)) + s.push(encodeURIComponent(key) + "=" + encodeURIComponent(val)) } return s.join("&") }
M
views/wonk.js
→
views/wonk.js
@@ -6,7 +6,7 @@ host.correctAnswer = word
host.guesses = [] host.xid = xid var xhr = new XMLHttpRequest() - xhr.open("GET", "/bloat/wonkles?w=" + escape(wordlist)) + xhr.open("GET", "/bloat/wonkles?w=" + encodeURIComponent(wordlist)) xhr.responseType = "json" xhr.onload = function() { var wordlist = xhr.response.wordlist