cleanup javascript a touch
Ted Unangst tedu@tedunangst.com
Mon, 19 Aug 2019 03:21:53 -0400
1 files changed,
3 insertions(+),
5 deletions(-)
jump to
M
views/honkpage.html
→
views/honkpage.html
@@ -14,13 +14,12 @@ {{ $BonkCSRF := .HonkCSRF }}
{{ if .TopXID }} <div class="info" id="refreshbox"> <script> -var topxid = {{ .TopXID }} +var topxid = "{{ .TopXID }}" function refreshhonks() { get("/?topxid=" + escape(topxid), function(xhr) { var doc = xhr.responseXML - topel = doc.children[0].children[1].children[0] - topxid = topel.innerText - honks = doc.children[0].children[1].children + topxid = doc.children[0].children[1].children[0].innerText + var honks = doc.children[0].children[1].children var mebox = document.getElementById("refreshbox") for (var i = honks.length; i > 1; i--) { mebox.insertAdjacentElement('afterend', honks[i-1])@@ -30,7 +29,6 @@ }
</script> <p><button onclick="refreshhonks()">refresh</button> </div> - {{ end }} {{ range .Honks }} {{ template "honk.html" map "Honk" . "BonkCSRF" $BonkCSRF }}