views:

29

answers:

1

My question is, how does Facebook, Omegle, and major chat applications code the title change on new message system. I want to, on change of a div, to change the <title> tag to something else than it already is set as. This is most likely accomplished in Javascript, but I'm not an expert in Javascript, so how is this written?

+1  A: 

Set document.title.

Some part of the code is obviously modifying the <div>. That's where you need to add the code to modify document.title.

Matthew Flaschen
I know about that, it doesn't tell me how to change the title on the change of a div. I also want to be able to detect whether they are actually on the page or not, to trigger that event accordingly.
Nik
Alright, so, how do we detect whether or not they are on the page?EDIT: Would detecting and setting a variable based on if an element or not was focused work for this?
Nik