[Javascript] Handling child window visibility...

Hakan Magnusson (Backbase) hakan at backbase.com
Thu Aug 12 09:53:18 CDT 2004


In the document inside the popup window, add this:

<body onload="top.focus();">

Should do the trick.

Regards,
H

Shawn Milo wrote:

> I have a form which has a target attribute.  This way, 
> when someone clicks the submit button on a page which
>  contains a Java graph applet, a new window opens with 
> a table of statistics based upon the data in the chart.
> 
> If the window is already open, it will simply refresh. 
>  This is fine, but my concern is that if the new window
>  is in the background, users will fail to realize this, click
>  repeatedly, then call me for help.
> 
> I have thought of two options.  The first is (if possible)
>  to check for the existance of the window during onclick
>  and close it.  The second is to put JavaScript in the
>  onload of the new window to bring it to the top.
> 
> Are either of these possible, and are either
>  of these recommended?  Any other solutions?
> 
> I am not creating this window with JavaScript by
>  using window.open() or anything -- 
> just a normal HTML form with target="statWindow"
>  in the declaration.
> 
> Thanks,
> Shawn
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 
> 



More information about the Javascript mailing list