Home > Web Front-end > JS Tutorial > body text

JavaScript tips for modifying browser tab titles_javascript tips

WBOY
Release: 2016-05-16 16:22:05
Original
1398 people have browsed it

Modifying the title of tab or window is an older practice. Gmail uses it to prompt users for new chat messages. When a new page is loaded through AJAX, this site also uses it to update the tab title. How is this done? At that time, it was by setting the document object.

Copy code The code is as follows:

document.title = 'Hello!'; // New title :)

A common mistake is: you will think that you should modify window.title. But in fact, you should use the document object, otherwise what you do will definitely be useless. Pay attention, you will see: many times setInterval is used to actually update document.title to attract the user's attention!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!