debugging

This commit is contained in:
Paul Liverman III 2018-04-24 16:38:38 -07:00
parent 2594301414
commit 3b90245740

View File

@ -20,9 +20,11 @@ function new_task() {
$.post("/v1/new", {api_key: API_KEY, content: input.val()}, function(data) { $.post("/v1/new", {api_key: API_KEY, content: input.val()}, function(data) {
// $("#new-task").before("<li><input type='checkbox' id='task-" + data.task.id + "' onchange='check(" + data.task.id + ")'> " + data.task.content + "</li>"); // $("#new-task").before("<li><input type='checkbox' id='task-" + data.task.id + "' onchange='check(" + data.task.id + ")'> " + data.task.content + "</li>");
let input = $("input", template); let input = $("input", template);
console.log(input);
input.prop("id", "task-" + data.task.id); input.prop("id", "task-" + data.task.id);
input.prop("onchange", "check('" + data.task.id + "')"); input.prop("onchange", "check('" + data.task.id + "')");
input.after(data.task.content); // not sure if will work input.after(data.task.content); // not sure if will work
console.log(input);
}) })
.fail(function(request) { .fail(function(request) {
// TODO handle error // TODO handle error
@ -42,7 +44,7 @@ function new_api_key() {
$("code", template) $("code", template)
.css("background-color", "red") .css("background-color", "red")
.css("color", "white") .css("color", "white")
.text(request.responseJSON.errors.join(" ")); .text("ERROR: " + request.responseJSON.errors.join(" "));
$("#new-api-key").before(template); $("#new-api-key").before(template);
}); });
} }