开发者

How to focus window/tab like alert()?

开发者 https://www.devze.com 2023-01-10 17:53 出处:网络
If in some of my tabs alert() is executed, then this tab becomes selected instantly. The thing is - this alert() box is ugly. I have createdwith my design and all.. But when I call it - tab is not sel

If in some of my tabs alert() is executed, then this tab becomes selected instantly. The thing is - this alert() box is ugly. I have created with my design and all.. But when I call it - tab is not selected/focused. window.focus(); does not work. Any ideas?开发者_Python百科


You cannot reliably force windows or tabs to grab focus. Some browsers are more amenable to the idea than others: IE will generally allow it, but Firefox has to be configured by the user to allow it, and Safari will basically never honor a focus request. (Well, almost never.)

0

精彩评论

暂无评论...
验证码 换一张
取 消