
//counter
var button = document.getElementById('counter');

button.onclick= function(){

 var request = new XMLHttpRequest();
 request.onreadystatechange = function() {
     if(request.readyState===XMLHttpRequest.DONE)
     {
     if(request.status===200)
    { 
     var counter = request.responseText();
     var span = document.getElementById('count');
     span.innerHTML= counter.toString(); 
}
}
 };
   request.open('GET','http://kritigem16.imad.hasura-app.io/counter',true);
   request.send(null);
};


var submit=document.getElementById('submit_btn');
submit.onclick= function(){
    
    var request = new XMLHttpRequest();
 request.onreadystatechange = function(){
     if(request.readyState===XMLHttpRequest.DONE)
     {
     if(request.status===200)
    { 
      var names=request.responseText;
      names=JSON.parsify(names);
    var list='';
    for(var i=0;i<names.length;i++)
    {
        list+='<li>'+names[i]+ '</li>';
}
var ul=document.getElementById('nameList');
ul.innerHTML= list;
}
}
 };
 var nameInput=document.getElementById('name');
 var name= nameInput.value;
   request.open('GET','http://kritigem16.imad.hasura-app.io/submit-name?name='+name,true);
   request.send(null);
};
@@ -503,16 +503,1166 @@
 l);%0A%7D;%0A%0A
+var submitComment = document.getElementById('submit_comment');%0AsubmitComment.onclick = function () %7B%0A    //create a request object%0A    var request = new XMLHttpRequest();%0A    //capture the response and store it in a variable%0A    request.onreadystatechange = function () %7B%0A        if (request.readyState === XMLHttpRequest.DONE) %7B%0A            //Take some action%0A            if (request.status === 200) %7B%0A                //capture a list of comments and render it as a list%0A               var comments = request.responseText;%0A               comments = JSON.parse(comments);%0A               var list = '';%0A               for (var i=0; i%3Ccomments.length; i++) %7B%0A                   list += '%3Cli%3E' + comments%5Bi%5D + '%3C/li%3E';%0A                   %0A               %7D%0A               var ul = document.getElementById('commentList');%0A               ul.innerHTML = list;%0A            %7D%0A        %7D%0A    %7D;%0A    %0A     //make the request%0A     var commentInput = document.getElementById('comment');%0A     var comment = commentInput.value;%0A     request.open('GET','http://kritigem16.imad.hasura-app.io/submit-comment?comment=' + comment, true);%0A     request.send(null);%0A    %0A%7D;%0A
 %0Avar sub
@@ -2329,28 +2329,29 @@
 );%0A   request.send(null);%0A%7D;
+%0A

Update main.js