• Welcome to the world's largest Chinese hacker forum

    Welcome to the world's largest Chinese hacker forum, our forum registration is open! You can now register for technical communication with us, this is a free and open to the world of the BBS, we founded the purpose for the study of network security, please don't release business of black/grey, or on the BBS posts, to seek help hacker if violations, we will permanently frozen your IP and account, thank you for your cooperation. Hacker attack and defense cracking or network Security

    business please click here: Creation Security  From CNHACKTEAM

浏览器不在当前页面时 标题值不同


Recommended Posts

当浏览器不在当前页面时,标题值是不同的。

基本上我在别人的博客网站上看到过一个效果。访问其他网站时,标题与当前网站中的标题不同。

mcja5dgov2p5232.png

421wvr3on545233.png

由于个人JS基础很差,可以讨论你的不同意,但是不要喷。谢谢合作~

1.首先明确如何在JS内修改标题。

document.title=‘’

5boktelxmnp5234.png

x2lqtpqfjvo5235.png

2.如何监控浏览器不在当前页面

window.onblurwindow.onfocus。

  ,当你浏览其他窗口,最小化浏览器,或点击其他程序时,判断浏览器失去当前页面的焦点。window.onblur。会被触发。

当你的页面重新获得焦点时,  将触发window.onfocus。

  是在生命周期函数mounted中编写的,因为可以在页面刚刚加载时直接使用。

lcpprwpyjst5236.png

Link to comment
Share on other sites