I am currently building a web email client and i was wondering how to code a function into it that shows a number appear telling you that you have unread mail if you are viewing another tab. Heres an example of what i mean if you don't understand. That is an example of what i mean from hotmail. If i'm in another tab and an email comes through it comes up with a 1. How do i go about coding this into mine? Any help would be much appreciated.
With the use of Ajax, you can periodically load a page which displays how many unread emails you have recieved. When this is not zero, you can change the title tag. Example using jquery: $.POST("ajax/check.php","",function(data){ if(data==0)document.title="Title"; else document.title = "Title ("+data")"; }); Code (markup):