debugging
This commit is contained in:
parent
2594301414
commit
3b90245740
@ -20,9 +20,11 @@ function new_task() {
|
||||
$.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>");
|
||||
let input = $("input", template);
|
||||
console.log(input);
|
||||
input.prop("id", "task-" + data.task.id);
|
||||
input.prop("onchange", "check('" + data.task.id + "')");
|
||||
input.after(data.task.content); // not sure if will work
|
||||
console.log(input);
|
||||
})
|
||||
.fail(function(request) {
|
||||
// TODO handle error
|
||||
@ -42,7 +44,7 @@ function new_api_key() {
|
||||
$("code", template)
|
||||
.css("background-color", "red")
|
||||
.css("color", "white")
|
||||
.text(request.responseJSON.errors.join(" "));
|
||||
.text("ERROR: " + request.responseJSON.errors.join(" "));
|
||||
$("#new-api-key").before(template);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user