diff --git a/etc/static/index.html b/etc/static/index.html index 7b0a074..391afde 100644 --- a/etc/static/index.html +++ b/etc/static/index.html @@ -18,14 +18,17 @@ function sendStatusChange(status) { var http = new XMLHttpRequest(); var url = "/minecraft-status"; - var data = "{\"status\":"+status+"}"; + + var data = JSON.stringify( + { status: status} + ) http.open("POST", url, true); //Send the proper header information along with the request http.setRequestHeader('Content-Type', 'application/json; charset=UTF-8'); // send the collected data as JSON - http.send(JSON.stringify(data)); + http.send(data); } function refreshLog() {