"NC" <su***************@gmail.com> wrote in message
news:11*********************@j55g2000cwa.googlegro ups.com...
Hi All,
We have an issue where if we say:
window.open(uri, 'QuickTradePopup',
'width=730,height=300,menubar=no,toolbar=no,scroll bars=yes,resizable=yes').
already existing window with name as 'QuickTradePopup' is not getting
overrided with new one.Ideally if we give a same window name it should
get overrided with existing window which has same name.This issue is
happening intermittently.
Please respond.
Sounds like a job for SmartPop. This will manage references to windows
that it opens, and pre-close any that you try to re-open.
Refer to the example usage.
<SCRIPT type='text/javascript'>
//S Chalmers 2006
SmartPop=
{
winData: {ref:[], title:[] },
up:function(locn, wName, paramString)
{
for(var i=0; i<this.winData.ref.length && this.winData.title[i]!=wName ;
i++)
;
if( i!=this.winData.ref.length && this.winData.ref[i].closed==false )
this.winData.ref[i].close();
if(locn != "")
{
this.winData.ref[i]=window.open(locn, wName, paramString);
this.winData.title[i]=wName;
}
return false;
}
}
</SCRIPT>
<A HREF='/' onclick='return
SmartPop.up("http://google.com","Google","width=200,height=200,top=200 ,left=200")'>Google
200x200</A><BR>
<A HREF='/' onclick='return
SmartPop.up("http://google.com","Google","width=300,height=300,top=200 ,left=200")'>Google
300x300</A><BR>
<A HREF='/' onclick='return
SmartPop.up("http://google.com","Google","width=400,height=400,top=200 ,left=200")'>Google
400x400</A><BR>
<A HREF='/' onclick='return SmartPop.up("","Google")'>Close Google</A><BR>