This week's book giveaway is in the Programmer Certification forum. We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Also, I'd suggest making req a global variable, and splitting the above function into two functions: one to initialize req, and another to send the message. Only the function to send the message should be put in the setInterval loop.
addMessages function is called on some onclick of button.
Thanks in advance Manoj Amrutkar
posted 13 years ago
Yes, I see what you mean about the recursive call. You might try increasing the time interval. It could be that the request isn't able to complete in the time allotted.
Also, try my earlier suggestion about only initializing the request once, and then doing the "send" part in a loop.