Possible to set tab focus in IE7 from JavaScript

前端 未结 5 911
逝去的感伤
逝去的感伤 2021-01-23 14:33

Is it possible to launch a new window in JavaScript using the window.Open function, then set the focus to that tab?

Here\'s what I\'m doing today:

             


        
5条回答
  •  囚心锁ツ
    2021-01-23 15:25

    Jay,

    You are seeing designed behavior. To limit opportunities for malicious behavior, scripts running in tabbed windows cannot affect other tabs.

    For more information, please see Tabbed Browsing for Developers at http://msdn.microsoft.com/en-us/library/ms537636.aspx :

    "The ability to open multiple documents within the same browser window has certain practical and security implications [...] Active tabs (tabs with focus) cannot be affected by scripts that run in inactive or background tabs."

    BR.

提交回复
热议问题