For example, when we have new message on http://facebook.com or http://gmail.com, site gives us signal about this, and this happened without refresh page. how it works? I Imagine this so:
some Jhon is registered user on site.
There is javascript code, which every 10 seconds sends AJAX request to messages table, for check: in table, has or not unread messages for john (architecture, how marking ready / unread messages, here not important), if Yes, site give signal to Jhon "You have several new messages".
Tell please, I am closer to the truth or not? If yes, I have also one questions please.