[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ajug-members]: javascript window.open single window
If you are opening a window with a windowname, then
that should take care of it.
You can also do couple of things in the code while
opening a window:
1.In the 'else section' of your code where you check
for refocus, check for the existense of the popup
window and then focus it to the same window.
2.Try this option: Instead of two if conditions, first
check to see if the window is open by window name and
then open a window and focus it.
Hope this might be of some help.
Thanks
Ismail
--- Mani Gudavalli <Manidhar.Gudavalli@eds.com> wrote:
> HI
> I have this javascript. When I poast my page to
> itselft based on the
> data this sctipt is executed and loads a popup
> window. However, each
> time I submit the page it is opening a new window.
> How to control my
> javascript to allways focus on the same popup
> window.
> In popup window , I display one page but redirected
> to a different site
> in the popup.
>
> example: popup link: mylink is a.jsp but that is
> redirected to www.yahoo.com
>
> thanks
> MANI
>
> function popupnr(mylink, windowname, refocus,
> wrongData)
> {
>
> var mywin, href;
> if (typeof(mylink) == 'string')
> href=mylink;
> else
> href=mylink.href;
> if (!window.mywin ) {
> mywin = window.open('', windowname,
> 'width=800,height=600,scrollbars=yes');
> }
> // if we just opened the window
> if (
> mywin.closed ||
> (! mywin.document.URL) ||
> (mywin.document.URL.indexOf("about") == 0)
> )
> mywin.location=href;
> else if (refocus)
> mywin.focus();
> return false;
>
> }
> //-->
> </SCRIPT>
>
__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com