473,599 Members | 3,139 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

window.open() opens two windows

MPH
Problem:
using a named window as target, a new window is opened anyway. Also, both
windows have the same name. This happens on SOME machines only

env:
XP sp2
ie6.0.2900.2180
+ sp2

Replicate with these two files, "test1.html "

<HTML><BODY>
<script>
function openit(){
var addlookup=open( 'about:blank',' addlookup');
document.f1.tar get="addlookup" ;
document.f1.sub mit();
}
</script>

<form name=f1 action="test2.h tml" >
<input type=button onclick="openit ();" value="open">
</form>

</BODY></HTML>

.... and "test2.html "

<HTML><BODY>
<script>
function showname(){
alert(self.name );
}
</script>
</HEAD>
<BODY>
Click this is to see window name <input type=button onclick="showna me();">
</BODY>
</HTML>

--------

if you use
var addlookup=open( 'test2.html','a ddlookup');
then you can see the same name being used twice.

We've had this problem on a few machines here (about 3 out of 20), which all
appear to have identical explorer settings.
A few posts here seem to have the same problem but no follow ups have
helped.

Hope someone can help.
Mike
Jul 23 '05 #1
13 8792
Lee
MPH said:

Problem:
using a named window as target, a new window is opened anyway. Also, both
windows have the same name. This happens on SOME machines only <script>
function openit(){
var addlookup=open( 'about:blank',' addlookup');
document.f1.tar get="addlookup" ;
document.f1.sub mit();
}
</script>


The open() method returns immediately, without waiting for the
windowing system to actually create the window. If that happens
to take a little longer on some machines, the new window won't
exist yet when you submit the form. Since no window exists by
the name "addlookup" , a new one is created.

setTimeout("doc ument.f1.submit ()",1000);

Jul 23 '05 #2
Lee wrote on 28 apr 2005 in comp.lang.javas cript:
MPH said:

Problem:
using a named window as target, a new window is opened anyway. Also, both
windows have the same name. This happens on SOME machines only

<script>
function openit(){
var addlookup=open( 'about:blank',' addlookup');
document.f1.tar get="addlookup" ;
document.f1.sub mit();
}
</script>


The open() method returns immediately, without waiting for the
windowing system to actually create the window. If that happens
to take a little longer on some machines, the new window won't
exist yet when you submit the form. Since no window exists by
the name "addlookup" , a new one is created.

setTimeout("doc ument.f1.submit ()",1000);


The same effect can be reached by just:

<script>
function openit(){
document.f1.tar get="_blank";
document.f1.sub mit();
}
</script>
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #3


Hi Lee,

Thanks for your quick response, however on replacing
"document.f1.su bmit();"with "setTimeout("do cument.f1.submi t()",1000);",
two windows are still displayed. What happens now is that the specified
window appears straight away with no content and a full browser window
appears with the content after the time specified in the second
parameter of settimeout().

Thanks

MPH

*** Sent via Developersdex http://www.developersdex.com ***
Jul 23 '05 #4
mph


Thanks Evertjan, however the problem is still the same two pop-up
windows are still being created. This is strange as the code has worked
correctly for the last couple of years and I have not changed the code
at all, but since a couple of days ago I have had this problem.

*** Sent via Developersdex http://www.developersdex.com ***
Jul 23 '05 #5
mph wrote on 28 apr 2005 in comp.lang.javas cript:
Thanks Evertjan, however the problem is still the same two pop-up
windows are still being created. This is strange as the code has worked
correctly for the last couple of years and I have not changed the code
at all, but since a couple of days ago I have had this problem.
Please quote, this is usenet, mnot email.
the problem is still


impossible with my code, please try again.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #6
MPH

Evertjan. wrote:
mph wrote on 28 apr 2005 in comp.lang.javas cript:
Thanks Evertjan, however the problem is still the same two pop-up
windows are still being created. This is strange as the code has worked correctly for the last couple of years and I have not changed the code at all, but since a couple of days ago I have had this problem.


Please quote, this is usenet, mnot email.
the problem is still


impossible with my code, please try again.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

My apologies Evertjan, as you rightly point out the code suggested by
yourself does only create the one required window. However I need to
use window.open() as this will allow me to determine the attributes of
the new window, it will also give me a window handle which I can use to
close the window elsewhere in my code.
Are you aware of a way that I may be able to achieve this?

Thanks

Jul 23 '05 #7
MPH wrote on 29 apr 2005 in comp.lang.javas cript:

Evertjan. wrote:
mph wrote on 28 apr 2005 in comp.lang.javas cript:
> Thanks Evertjan, however the problem is still the same two pop-up
> windows are still being created. This is strange as the code has worked > correctly for the last couple of years and I have not changed the code > at all, but since a couple of days ago I have had this problem.


Please quote, this is usenet, mnot email.
> the problem is still


impossible with my code, please try again.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

My apologies Evertjan, as you rightly point out the code suggested by
yourself does only create the one required window. However I need to
use window.open() as this will allow me to determine the attributes of
the new window, it will also give me a window handle which I can use to
close the window elsewhere in my code.
Are you aware of a way that I may be able to achieve this?


I don't think you can submit to 'about:blank'

But try this, works fine here:

========== test.html ===============

<script type='text/javascript'>
var addlookup=open( '','blah');

function openit(){
setTimeout('sub mitIt()',1000)
}

function submitIt(){
document.forms. f1.submit();
}

openit()
</script>

<form name=f1 target='blah' action='test2.h tml'>
<input name=a value=b>
</form>

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #8
MPH
"Evertjan." <ex************ **@interxnl.net > wrote in message news:<Xn******* *************@1 94.109.133.29>. ..
MPH wrote on 29 apr 2005 in comp.lang.javas cript:

Evertjan. wrote:
mph wrote on 28 apr 2005 in comp.lang.javas cript:

> Thanks Evertjan, however the problem is still the same two pop-up
> windows are still being created. This is strange as the code has

worked
> correctly for the last couple of years and I have not changed the

code
> at all, but since a couple of days ago I have had this problem.

Please quote, this is usenet, mnot email.

> the problem is still

impossible with my code, please try again.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

My apologies Evertjan, as you rightly point out the code suggested by
yourself does only create the one required window. However I need to
use window.open() as this will allow me to determine the attributes of
the new window, it will also give me a window handle which I can use to
close the window elsewhere in my code.
Are you aware of a way that I may be able to achieve this?


I don't think you can submit to 'about:blank'

But try this, works fine here:

========== test.html ===============

<script type='text/javascript'>
var addlookup=open( '','blah');

function openit(){
setTimeout('sub mitIt()',1000)
}

function submitIt(){
document.forms. f1.submit();
}

openit()
</script>

<form name=f1 target='blah' action='test2.h tml'>
<input name=a value=b>
</form>

Thanks for the example, yes it does work for me, but it does not give
me any control over when the child window is created, this is a
problem because of the way child windows are used on my website.

As mentioned before myself and others have been using the current code
for the last couple of years without a problem, but I can no longer
get the current code to work, and I have not knowingly made any
changes.

Is the behaviour shown in the code symptomatic of any obvious settings
in windows or IE?

Thanks for your help.
Jul 23 '05 #9
MPH wrote on 03 mei 2005 in comp.lang.javas cript:
Is the behaviour shown in the code symptomatic of any obvious settings
in windows or IE?


I don't know. Possibly the/a popup blocker is interfering?

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #10

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

Similar topics

6
8219
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 could help me here...? I'd like to use the window.open() script to open a separate window, because I'd like to hide the menubar and specify the window size as well. So I specify "javascript:window.open(...)" as the HTML link for a hotspot. However,...
10
6726
by: David McCulloch | last post by:
The following code opens a new window, but the "resizeTo" doesn't resize it. Why not? (Don't ask why I simply did not open the window with the new size....my original problem was how to open a new window with maximized dimensions!) FYI, I uploaded the same code to: http://tosasoft.com/test/open.htm ========================================
3
4287
by: Mehmet Gunacti | last post by:
Hello, on our homepage, when pressing an anchor tag, a special sized popup window opens via javascript. but it opens very slowly. on other web pages, there are also javascript-opened windows, but they load very very fast, within 2-3 seconds. i tried several things such as :
7
3211
by: E Michael Brandt | last post by:
I have been lurking here for some time, and now would like to ask a question of you clever coders: My JustSo PictureWindow 3 Extension for Dreamweaver has stumbled in the face of the new Opera 8. Jspw3 opens a popup window (using varname=window.open(...)) but there are now two problems: 1) Opera8 interprets a top,left of 0,0 to be top left of the browser window rather than of the entire screen, unlike the other modern browsers I've...
8
5630
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 popWindow=window.open('http://www.yahoo.com','','width=600,height=400,toolbar=1,location=1,menubar=1,resizable=1,titlebar=1,directories=1,status=1,scrollbars=1'); the sidebars are disabled. I click on the buttons for bookmarks and history and they do nothing. I...
4
47475
by: Bill | last post by:
I need help closing a CMD window when it is executed from Access. 1) The batch file is called from Access. 2) Access closes, 3) the batch runs a copy of the access database (creating a backup) 4) Once the copy is complete, the batch file opens the Access database again 5) EXIT should close out the cmd window but it does not execute that line
4
1450
by: Brian Shannon | last post by:
I have a javascript function that is executed when a link button is clicked: If Not (Page.IsClientScriptBlockRegistered("PopupWindow")) Then Page.RegisterClientScriptBlock("PopupWindow", Script) End if Script is a variable that is filled from calling a function that filles in all the assigned variables for the new window to open.
4
3756
by: MrMike | last post by:
Hi. I have a hyperlink control (lnkViewLogData) which is assigned the following attribute when the page loads... Me.lnkViewLogData.Attributes.Add("onClick", _ "javascript:window.open('Input_New_Record_CustomerInformation.aspx?CustomerID=" & Me.lblCustomerID.Text & "','myWin','');") As you can see, when this attribute is assigned the hyperlink is formatted to pop open another window. The problem is that when the window opens, it...
4
3231
by: arajunk | last post by:
In Firefox this opens a full size window (maximized) . In IE it opens the partial window requiring user to click restore (upper right) to maximize. What am I missing ? var infoWindow=window.open('usgsMain.html','USGSwindow','status=no,resizable=yes,scrollbars=yes');
6
18214
by: mistral | last post by:
what is correct way open a PDF document in new window use hyperlink? I want show images thumbnails linked with PDF files, when click on thumbnail, PDF will be opened in new window. Some of PDF files are in the same web server, other are in a remote location. Any help will be appreciated.
0
7916
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8404
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8053
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8268
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6729
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5866
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3900
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1508
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1252
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.