PopUp Focus - How To?

Giganews Newsgroups
Subject: PopUp Focus - How To?
Posted by:  theintrepidf…@hotmail.com
Date: 22 Feb 2005

Dear Group

I wondered whether you can help me with this. I do have a page that
contains a button and an IFrame. The IFrame contains a dummy page that
is set to redirect to a word document when loaded so eventually the
word document will be displayed in the IFrame. That works all well. No
problem.

The only trouble I have is with the button contained on the parent
page. When pressed, it runs this script:

<script language=JavaScript>
window.open('download.aspx','download','width=320,height=150,resizable=no,scrollbars=no');</script>

which opens a little download window where the word document can be
downloaded to the client. The window opens perfectly fine but always
ends up behind the parent page because the button click unavoidable
reloads the parent page (That's ok) but then triggers the dummy page to
load the document which will give the focus to the paren page. So the
pop-up is only shown for a second in the foreground and then
disappears.
I have tried placing a window.focus(newwindow) script on the dummy page
but then I can't see the pop-up at all. I might do something wrong with
the window.focus script as I'm not so good in Java.
If you have any ideas, please let me know.

Thank you very much for your help & efforts!
Have a nice day!

Martin

Replies