Click to See Complete Forum and Search --> : code to have page move to front if accessed again


cmscholt
12-17-2003, 03:17 PM
Hello,
I am coding a frameset that can be opened periodically. If the frameset is opened already, it may move to the background. Then, when it is opened again, it stays in the background. How can I make it come to the foreground every time it is opened rather than staying in the background.

Kor
12-18-2003, 03:55 AM
use focus() command (the focus can be used both as an event handler and a command, an implicit function...)

Try this

<body onload = "document.body.focus()">

in the page you want to be, as you said "in foreground"...

cmscholt
12-18-2003, 02:07 PM
Thanks for the tip. I ended up adding this
document.body.focus();
to the onLoaded method I already had in some script.