views:

121

answers:

1

I have a chat in a popup browser window. This chat page (ASP) checks for new messages every 10 seconds.

I would like to bring this popup window to front when there is a new message. I tried with "window.focus()", but this work only in few version of IE.

Are there other options to achieve my goal?

+4  A: 

Don't steal the focus.

And no, it will work only in some IEs, as you said. Quoting Mozilla's developer network,

It may fail due to user settings and the window isn't guaranteed to be frontmost before this method returns.

This is valid for all modern browsers, I guess.

You can use the following approach in order to notify the user of an activity.

Alexander Gyoshev