0

I'm trying to open a popup window and focus on it but my efforts are in vain. Occasionally, the popup goes behind the main window. My desktop is shared by two screens and I am using Internet Explorer 8. Any help is greatly appreciated.

window.open(url,'_blank').focus();
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Narayana Nagireddi
  • 729
  • 1
  • 13
  • 33
  • Can u try it with setTimeout: `var w=window.open(url,'_blank'); setTimeout(function(){w.focus()},10);` – Yuriy Galanter Jul 26 '13 at 23:22
  • 1
    ... or alternatively put `window.focus()` in a `window.onload` event handler in the pop-up. Though this can be done only, if you have control over `url` source file. – Teemu Jul 26 '13 at 23:35
  • @YuriyGalanter: But my `window.open` returns `null` for some reason even if the window is opened behind, tried to investigate about that but didn't find any clue. – Narayana Nagireddi Jul 27 '13 at 04:24
  • 1
    @User49234123412341 in every browser or just IE? About IE check http://stackoverflow.com/a/7025648/961695 – Yuriy Galanter Jul 27 '13 at 04:27
  • Thanks for the link, it's just in IE but apparently I can't notify to each and every user to disable protected mode. – Narayana Nagireddi Jul 27 '13 at 04:30

0 Answers0