cleanup javascript a touch

This commit is contained in:
Ted Unangst 2019-08-19 03:21:53 -04:00
parent 072890112c
commit bdda6a5880
1 changed files with 3 additions and 5 deletions

View File

@ -14,13 +14,12 @@
{{ 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 @@ function refreshhonks() {
</script>
<p><button onclick="refreshhonks()">refresh</button>
</div>
{{ end }}
{{ range .Honks }}
{{ template "honk.html" map "Honk" . "BonkCSRF" $BonkCSRF }}