diff --git a/static/js/index.js b/static/js/index.js index 52d0073..6e93f17 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -1,20 +1,14 @@ $(document).ready(function () { + var results = Array(); $("#demo").click(function (e) { e.preventDefault(); //alert("hello world"); begin(); + console.log(results); }); function begin() { - /*var xhr = new XMLHttpRequest(); - xhr.open('get', '/begin?begin=1'); - xhr.onload = function () { - var response = xhr.responseText; - console.log(response); - var json_data = eval('(' + response + ')'); - console.log(json_data); - } - xhr.send(null);*/ + let tmp; $.ajax({ type: "get", url: "/begin", @@ -22,23 +16,49 @@ $(document).ready(function () { success: function (res) { switch (res.option) { case "+": - $("#ul").append("