我尝试使用非常基本的HTML将标题栏设置为flash.我已经给了它一个镜头,但下面的代码似乎不起作用,我不知道为什么.此外,有没有办法使标题栏闪存文本,但只有当用户没有查看当前的浏览器页面?
我的尝试:
function Flash() {
window.setTimeout(function() {
alert(document.title);
document.title = (document.title == "Company" ? "Company - flash text" : "Company");
}, 1000);
this.stop = function() {
document.title = "Company";
clearTimeout(this.timer);
}
}
Run Code Online (Sandbox Code Playgroud)