Focus on new browser window

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I am having a problem with opening a new browser window through a
client-side javascript (window.open/_blank) function. The window do "pop up"
but behind the window where I pushed the "pop up" button. It works ofcause
with the window.showModalDialog method but then postback causes another
window to pop up, so I'm back to the window.open method.

How can I set foucs on the new pop-up window from the parent browser window?

Thanks
Peter
 
Hello,

Use the focus() method on the opened window reference as in:

<script>
function popupWindow()
{
var popWin = window.open ("http://www.google.com", "newWin");
popWin.focus();
}
</script>

Hi

I am having a problem with opening a new browser window through a
client-side javascript (window.open/_blank) function. The window do "pop up"
but behind the window where I pushed the "pop up" button. It works ofcause
with the window.showModalDialog method but then postback causes another
window to pop up, so I'm back to the window.open method.

How can I set foucs on the new pop-up window from the parent browser window?

Thanks
Peter
 
Peter,

Use window.showModalDialog and put a line

<base target=_self>

in the <head> section of the dialog to solve the "another window on
postback" problem.

Eliyahu
 
Back
Top