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?
views:
29answers:
1
+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
2010-06-19 15:45:50
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
2010-06-19 15:47:41
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
2010-06-19 15:54:03