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.