[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
javascript window.open single window
- To: ajug-members@ajug.org
- Subject: javascript window.open single window
- From: Mani Gudavalli <Manidhar.Gudavalli@eds.com>
- Date: Thu, 11 Mar 2004 16:04:43 -0600
- User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
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>