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:
var winRef = window.open(outUrl,wName,'left='+ wX +',top=' + wY + ',height=' + wH + ',width=' + wW + args); try { // Not all window types support the focus() property. winRef.focus(); } catch (exception) { }
The window opens, but the new tab doesn’t receive focus.
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.