I want an alert to pop up whenever a new message is received.
Here's the ajax code to receive the message from server.
Code: Select all
Where should i put alert('New message received'); so that it only pops up only when a new message is received?
If i put alert in success function it is popping up every second.