I'm wondering how SO is able to display the "New answers have been posted" message when I'm typing an answer for a question. Does my browser send an AJAX request to the SO servers, or does SO send a trigger back to my browser?
What is meta?
- Any Stack Exchange user can ask a question
- The community provides support, votes on ideas, and reports bugs
- Your voice helps shape the way Stack Exchange operates
SO can't send trigger to the browser due to the very nature of web.
SO is using AJAX indeed, here is part of the code responsible for that nice message:
The server is sending back the amount of new answers and if positive, the message is displayed.
If you really want, shouldn't be too hard to find the actual code invoking the AJAX request. :)
EDIT: This is not relevant anymore due to real time updates using web sockets:
The former; it sends an AJAX request to