window.open() Question?

N

NC

Hi All,

We have an issue where if we say:

window.open(uri, 'QuickTradePopup',
'width=730,height=300,menubar=no,toolbar=no,scrollbars=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.

Regards,
N.C
 
S

Stephen Chalmers

NC said:
Hi All,

We have an issue where if we say:

window.open(uri, 'QuickTradePopup',
'width=730,height=300,menubar=no,toolbar=no,scrollbars=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!=wName ;
i++)
;

if( i!=this.winData.ref.length && this.winData.ref.closed==false )
this.winData.ref.close();

if(locn != "")
{
this.winData.ref=window.open(locn, wName, paramString);
this.winData.title=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>
 
R

Randy Webb

Stephen Chalmers said the following on 6/1/2006 7:46 PM:
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.

<snip>

Have you tested that code with Symantec's popup blocking?

Insert this at the beginning of your script block, then test it:

var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen

It makes it pretty tough to try to circumvent. You could test for the
existence of SymRealWinOpen or SymWinOpen but as soon as the spammers
discover that trick it will be fixed again so that it isn't so simple to
detect Nortons popup blocker.
 
S

Stephen Chalmers

Randy said:
Have you tested that code with Symantec's popup blocking?

You mean the code they've withdrawn:
url:http://www.zdnet.com.au/news/securi...V_script_blocker/0,2000061744,39234250,00.htm
Insert this at the beginning of your script block, then test it:

var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen

I don't see the point you're making. My routine is intended to manage
the repeated opening of requested windows, which in practice will not
be blocked by the user. It has nothing to do with trying to circumvent
any level of popup blocking.
 
R

Randy Webb

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top