473,471 Members | 4,687 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

window.open() Question?

NC
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.

Regards,
N.C

Jun 1 '06 #1
4 1769

"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>
Jun 1 '06 #2
Stephen Chalmers said the following on 6/1/2006 7:46 PM:
"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.


<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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 2 '06 #3
Randy Webb wrote:
Have you tested that code with Symantec's popup blocking?
You mean the code they've withdrawn:
url:http://www.zdnet.com.au/news/securit...9234250,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.
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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


Jun 2 '06 #4
Stephen Chalmers said the following on 6/2/2006 8:13 AM:
Randy Webb wrote:
Have you tested that code with Symantec's popup blocking?


You mean the code they've withdrawn:
url:http://www.zdnet.com.au/news/securit...9234250,00.htm


Actually, it is pleasing to know that but the article doesn't address
the popup blocker itself. It had flaws but that wasn't why it was
withdrawn <shrug>
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.


No other point than the futility of attempting to open new windows and
nothing more.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 2 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Michael | last post by:
I am trying to allow a user to view a PDF in a new window. I currently have this working using the following: <a href="./pdf.do?parameter=01121980" target="top"><b>pdf</b></a> The problem...
4
by: Jamie Jackson | last post by:
The crux of the problem is I only know if the popup *has been* opened, but not if it *is* open. Therefore, the script doesn't know whether to simply refocus, or whether to popup a fresh window. ...
6
by: Les | last post by:
Hi, I'd like to find out how to use the window.open() script in Fireworks MX. I have posted my question in the Fireworks forum but didn't get any replies. Since it's javascript, maybe someone...
12
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank,...
44
by: Carlos Andr?s | last post by:
Hi everybody. I've got a problem. I'd like to avoid opening a new window when you have pressed the shift key and you click in the left button of the mouse. I've tried the next solution, in the...
32
by: Eli | last post by:
How can I POST a form into a new window where I control the size and other attributes of the new window? Also. Are there any implications, perhaps due to browser security (Interne Explorer?)...
2
by: cschang | last post by:
I am not sure this is the right place to ask this question. I have a web page composed with two frames (left and right). Then in my frmae2(right one) , I open a pop-up window by javscript:...
8
by: Dominic Tocci | last post by:
I'm searching for a way to use window.open on my web page to open a window in firefox that allows the sidebars to work (bookmarks, history, etc). When I use the following: var...
8
by: johnsonholding | last post by:
Here is the code for a pop-up window that works in Firefox and not in IE - I get a java error or something, Here is the code : </script> <SCRIPT language="JavaScript"...
7
by: Dr J R Stockton | last post by:
I want page <URL:http://www.merlyn.demon.co.uk/js-quick.htmto open, in IE6, IE7, Firefox 2, and wherever else practicable, with the control labelled F.X0 fully visible at the top of the window and...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.