Skip to content

Commit

Permalink
#92, correct some mistakes with getting comment test from server to e…
Browse files Browse the repository at this point in the history
…dit algo
  • Loading branch information
thrize committed Apr 14, 2018
1 parent f5e25f8 commit af896b8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion html/edit-algo-part-2.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="row">
<div class="col-sm-4">
<form class="form-add" action="/edit-algo-comment" method="post" onload="javascript:getComment()">
<form class="form-add" action="/edit-algo-comment" method="post">
<textarea name="comment-block" id="comment-block" cols="150" rows="10"></textarea>
<button class="btn btn-lg btn-primary btn-block" type="submit" value="POST">Save comment</button>
</form>
Expand Down
2 changes: 2 additions & 0 deletions public/js/editalgo.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ function getComment() {
});
}

window.onload = getComment;

function getCookie(cname) {
console.log("getCookie: all cookies: "+document.cookie);
var name = cname + "=";
Expand Down
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ app.get("/get-comment", function(req, res) {
*/
// TODO : actually get comment
console.log('/get-comment, sending comment: ' + 'Test comment text');
res.json({comment: 'Test comment text'});
res.json({comment: btoa('Test comment text')});
});

/*
Expand Down

0 comments on commit af896b8

Please sign in to comment.