Javascript - 如何使浏览器切换标签? [英] Javascript - How to make a browser switch tabs?

查看:92
本文介绍了Javascript - 如何使浏览器切换标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的代码中,定时事件会启动ModalDialog。如果用户在事件之前切换选项卡,则选项卡会闪烁,但就是这样。

In my code a timed event launches a ModalDialog. If the user switches tabs before the event the tab blinks but that is it.

有没有办法让浏览器切换到对话框所在的选项卡?

Is there a way to make the browser switch to the tab the dialog is on?

谢谢

干杯提供所有建议。我之前应该说,但代码只能通过IE运行,并且不允许用户更改任何设置。

Cheers for all your advice. I should of said before but code will only be run through IE and the users are not allowed to alter any settings.

推荐答案

那里不是跨浏览器的方式确实专注于100%可靠的选项卡/窗口,尤其是在较新的浏览器中。这将是广告商的梦想......所以在大多数新版浏览器中主动阻止

There isn't a cross-browser way do focus a tab/window that's 100% reliable, especially in newer browsers. This would be an advertisers dream...so it's actively blocked in most newer browsers.

作为用户,我很高兴这很难在大多数情况下,其他人不可能这样做。

As a user, I'm glad it's difficult in most cases, impossible in others to do this.

这篇关于Javascript - 如何使浏览器切换标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆