Display a string variable in javascript chatbot - takes 1 min to debug, instant funds transferred ! (codepen included)
₹600-1500 INR
已完成
已发布将近 5 年前
₹600-1500 INR
货到付款
I need to be able to display a string variable named ' data ' inside the response bubble of a chat-widget, The data variable comes in from back-end real-time.
So, the List of Strings are specified in a template
And a response is chosen
(function(){
var chat = {
messageToSend: '',
messageResponses: [
'Why did the web developer leave the restaurant? Because of the table layout.',
'How do you comfort a JavaScript bug? You console it.',
'An SQL query enters a bar, approaches two tables and asks: "May I join you?"',
'What is the most used language in programming? Profanity.',
'What is the object-oriented way to become wealthy? Inheritance.',
'An SEO expert walks into a bar, bars, pub, tavern, public house, Irish pub, drinks, beer, alcohol'
],
init: function() {
[login to view URL]();
[login to view URL]();
[login to view URL]();
},
I need to be able to display a string variable's contents (data) here instead of these ready made strings
*This string variable receives real-time data from the back end
So, this was tried
var contextResponse = {
response: data
time: [login to view URL]()
};
This was for a chatbot, you can find the code here,
[login to view URL]
For now, when u are done altering the code let me know, I will just send a message to data and we can check if it is displayed - that's it receive your payment :)
Dear employer,
As requested, I have updated the codepen to accept data from API and show it in chat window. I have added a new function addResponse to accept data received and render it in the chat.
[login to view URL]
Could you kindly test by sending a message?
Please inform me if you need anymore customization.
Thanks
Manish