summaryrefslogtreecommitdiff
path: root/html/vote.js
diff options
context:
space:
mode:
Diffstat (limited to 'html/vote.js')
-rw-r--r--html/vote.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/html/vote.js b/html/vote.js
new file mode 100644
index 0000000..90811e0
--- /dev/null
+++ b/html/vote.js
@@ -0,0 +1,10 @@
+function vote(id, value) {
+ var http = new XMLHttpRequest();
+ http.open("GET","/vote?id="+id+"&vote="+value);
+ http.onreadystatechange=function() {
+ if(http.readyState==4) {
+ document.getElementById("v"+id).innerHTML = http.responseText;
+ }
+ }
+ http.send(null);
+}