Skip to content

Commit

Permalink
better AJAX request
Browse files Browse the repository at this point in the history
  • Loading branch information
stsievert committed Jul 5, 2021
1 parent b83f89b commit 705159b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions templates/query_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@
var response_time = getTime() - response_start;
num_queries = num_queries + 1;
$("#num-queries").html("" + num_queries);
$.post("/answer",
JSON.stringify({
var data = {
"head": head,
"left": left,
"right": right,
Expand All @@ -181,8 +180,14 @@
"network_latency": latency,
"score": score,
"alg_ident": ident,
})
);
};
$.ajax({
"url": "/answer",
"method": "POST",
"dataType": "json",
"contentType": "application/json",
"data": JSON.stringify(data),
});
}
}

Expand Down

0 comments on commit 705159b

Please sign in to comment.