cleanup javascript a touch
This commit is contained in:
parent
072890112c
commit
bdda6a5880
|
@ -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 }}
|
||||
|
|
Loading…
Reference in New Issue