Fixed posting flags towards the server
This commit is contained in:
		| @ -4,10 +4,15 @@ $(document).ready(function () { | ||||
|         $.ajax({ | ||||
|             type: 'POST', | ||||
|             url: 'challenge/3', | ||||
|             data: JSON.stringify ({comment: commentInput}), | ||||
|             data: JSON.stringify({comment: commentInput}), | ||||
|             contentType: "application/json", | ||||
|             dataType: 'json' | ||||
|         }); | ||||
|         }).then( | ||||
|             function () { | ||||
|                 getChallenges(); | ||||
|                 $("#commentInput").val(''); | ||||
|             } | ||||
|         ) | ||||
|     }) | ||||
|  | ||||
|     var html = '<li class="comment">' + | ||||
| @ -23,13 +28,18 @@ $(document).ready(function () { | ||||
|         '</div>' + | ||||
|         '</li>'; | ||||
|  | ||||
|     $.get("challenge/3", function (result, status) { | ||||
|         for (var i = 0; i < result.length; i++) { | ||||
|             var comment = html.replace('USER', result[i].user); | ||||
|             comment = comment.replace('DATETIME', result[i].dateTime); | ||||
|             comment = comment.replace('COMMENT', result[i].comment); | ||||
|             $("#list").append(comment); | ||||
|         } | ||||
|     getChallenges(); | ||||
|  | ||||
|     }); | ||||
|     function getChallenges() { | ||||
|         $("#list").empty(); | ||||
|         $.get("challenge/3", function (result, status) { | ||||
|             for (var i = 0; i < result.length; i++) { | ||||
|                 var comment = html.replace('USER', result[i].user); | ||||
|                 comment = comment.replace('DATETIME', result[i].dateTime); | ||||
|                 comment = comment.replace('COMMENT', result[i].comment); | ||||
|                 $("#list").append(comment); | ||||
|             } | ||||
|  | ||||
|         }); | ||||
|     } | ||||
| }) | ||||
		Reference in New Issue
	
	Block a user