Wednesday, October 8, 2008

Window opened from javascript

When using javascript to open a window, it appears on top.
When this window loses focus (gets in the background),
and the user clicks the link again, the window is reloaded,
but does not get the focus again.

Since for some people this is important, the solution is to make sure the opened window has the focus :

var openedWindow = window.open("someurl", "somewindowname");
openedWindow.focus();


This will refocus the opened window.

No comments: