[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ajug-members]: javascript window.open single window




Maybe you can try this.

var mywin;

if(mywin.location.href)
{
        mywin.location.href='http://www.newpage.net';
}
else
{
        mywin=window.open(........);
}


I think this should work.

-Jason



Mani Gudavalli <Manidhar.Gudavalli@eds.com>

03/11/2004 05:04 PM

Please respond to
ajug-members@ajug.org

To
ajug-members@ajug.org
cc
Subject
[ajug-members]: javascript window.open single window





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>