[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;