Showing custom text on the taskbar browser tab
Solution 1
The contents of the title could either be set by the default HTML originating from the server-side in the <title></title>
element, or it could be set using the document.title
property in Javascript.
Solution 2
Well you answered most of this question yourself.
The missing piece of the puzzle is that you can change the page title dynamically using javascript:
document.title = "(2) New title"
Comments
-
Istiaque Ahmed almost 2 years
For example suppose you have 3 notifications in Facebook.
When you open the website, you see a browser tab (?) on the taskbar showing '(3) Your name' in Chrome or '(3)Facebook- Mozilla...' in Firefox.
For a webpage, the title value (plus browser dependent text) is shown as text in the browser tab and on the taskbar.
How can I add the number of notifications (i.e. 3 here) there? Is it done with HTML, JavaScript or what?