`; $("#loading").remove(); addMessage(htmlText); // Generate new questions to fill the suggested question buttons $.get(botUrl+"/genq", {}) .done(function(questions) { document.getElementById("btn1").value = questions.split("\n")[0]; document.getElementById("btn1").textContent = questions.split("\n")[0]; document.getElementById("btn2").value = questions.split("\n")[1]; document.getElementById("btn2").textContent = questions.split("\n")[1]; }); event.preventDefault(); }); $("#message").val(""); } // logs the response in the console function callbackFunc(response) { console.log(response); } /** * Add a message to the chat * * @param {string} msg The message */ function addMessage(msg) { $('#display').append(msg); $('#display').stop ().animate ({ scrollTop: $('#display')[0].scrollHeight }); } /** * Get a time stamp * * @return {string} the time */ function getTime() { var d = new Date(); var m = d.getMinutes(); if(m < 10) { m = "0"+m; } var h = d.getHours(); if(h > 12) { h = h-12; } return h + ":" + m; }