In Gmail when a new email is received, the page automaticly show the mail without refreshing, how this can be done?
It's done by using ajax. Coincidentally, the question was tagged "ajax".
From wikipedia: http://en.wikipedia.org/wiki/Ajax_(programming)
"Ajax (pronounced /ˈeɪdʒæks/; shorthand for Asynchronous JavaScript and XML)[1] is a group of interrelated web development methods used on the client-side to create interactive web applications. With Ajax, web applications can retrieve data from the server asynchronously in the background without interfering with the display and behavior of the existing page. Data is usually retrieved using the XMLHttpRequest object. Despite the name, the use of XML is not needed, and the requests need not be asynchronous.[2]"