473,806 Members | 2,253 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple windows using window.open()

Sam
I have 2 jsp pages which are loaded from the same browser window.
Inside these jsp pages, I have created 2 windows to write client side
log. I have used different id for 2 windows as follow.

In JSP1 page I create one window & second window is created in jsp2
page.

Win1 = window.open('Lo g1', 'win1',
config='right=0 ,top=60,toolbar =0,width=300,he ight=300,resiza ble=1,scrollbar s=1,location=no ,status=no
');

Win1.document.w riteln(yyyy + '-' + mm + '-' + dd + ' ' + hh + ':' + mn
+ ':' + ss + ',' + ms);

Win2 = window.open('Lo g2', 'win2',
config='right=0 ,top=60,toolbar =0,width=300,he ight=300,resiza ble=1,scrollbar s=1,location=no ,status=no
');

Win2.document.w riteln(yyyy + '-' + mm + '-' + dd + ' ' + hh + ':' + mn
+ ':' + ss + ',' + ms);

When the page loads I can see 2 pop-up windows just fine. But then all
the writeln statements(from page1 & page2) go to the win2. Even the
writeln statements from page1. I would like to have page1 log go to
win1 & page2 go to win2. What I am doing wrong?

Mar 24 '06 #1
1 2556
Sam said the following on 3/23/2006 8:59 PM:
I have 2 jsp pages which are loaded from the same browser window.
Inside these jsp pages, I have created 2 windows to write client side
log. I have used different id for 2 windows as follow.

In JSP1 page I create one window & second window is created in jsp2
page.

Win1 = window.open('Lo g1', 'win1',
config='right=0 ,top=60,toolbar =0,width=300,he ight=300,resiza ble=1,scrollbar s=1,location=no ,status=no
');
Is Log1 the name of a file? If nothing else, it should be a blank file
that you can write to.
Win1.document.w riteln(yyyy + '-' + mm + '-' + dd + ' ' + hh + ':' + mn
+ ':' + ss + ',' + ms);
Win2 = window.open('Lo g2', 'win2',
config='right=0 ,top=60,toolbar =0,width=300,he ight=300,resiza ble=1,scrollbar s=1,location=no ,status=no
');
Same here with Log2, the first parameter is the name of the file to open
in the new window.

Note: There is no config= in the third parameter to window.open, drop it:

window.open([resource],[windowName],[windowParameter s]);
Win2.document.w riteln(yyyy + '-' + mm + '-' + dd + ' ' + hh + ':' + mn
+ ':' + ss + ',' + ms);
Changing the Log1 and Log2 to about:blank I don't get the behavior you
describe.
When the page loads I can see 2 pop-up windows just fine. But then all
the writeln statements(from page1 & page2) go to the win2. Even the
writeln statements from page1. I would like to have page1 log go to
win1 & page2 go to win2. What I am doing wrong?


Use a dummy page (blank.html) to load instead of Log1 and Log2, or, make
them actual pages. Other than that, I can't duplicate what you are
describing.
--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 24 '06 #2

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

Similar topics

7
3204
by: Evan Kontos | last post by:
I am using the window.open function to open a small window and I am using GET to get values back from that window. I want to be able to open another from the second window but I get an error message when I try to do another window.open. Any suggestions are welcomed. Evan Kontos | EKontos@comtekcadd.com 27 Whitehall St. | 3rd Floor | New York, NY 10004 Tel 212.480.8166 | Fax 212.480.8167 | Personal Fax 786.513.0295...
3
1900
by: Voetleuce en f?nsievry | last post by:
G'day I'm looking for a script that can search multiple instances of Google (or other search engines optionally). The user types in a single word in the text field, presses ENTER or the submit button, and the browser launches several instances of Google with the single word + other search terms. I would like to have this script because I'm a translator and frequently need to look up the meaning of words. I Google using
1
4569
by: ian.michel | last post by:
I have a parent window that pushes a new window object onto an Array with the following code : OpenChild() { //totalNumWindowsCreated is global totalNumWindowsCreated = totalNumWindowsCreated + 1; childWnds.push(window.open(link, "child" +
2
4421
by: Geoff collishaw | last post by:
I'm trying to create a form where: (a) The user is given a list or Reporting Services reports in a listbox (b) When the user clicks on a button, then these reports are opened in SEPARATE windows. So, if there's three reports listed then 3 extra browser windows will open IN ADDITION to the one that's already open. I can use the following line:
2
8005
by: Jim Tilson | last post by:
I'm having a problem with Session ID being duplicated across multiple IE windows. I edited the web.config for my ASP.net web application to display trace information on the page. I open an IE window and navigate to the home page of my ASP.net app, and note the Session ID that was assigned. I then type CTRL-N to open a new IE window. The session ID displayed on the
4
4099
by: Robert Inder | last post by:
I am trying to build an interface for browsing a web-accessible database from a twin-monitor "kiosk", using Windows XP, with the option to "extend the desktop" onto the second screen. I want to control the way windows are positioned on the two screens. ((Note: this is a "special case" interface. It is NOT part of the normal web site, it is only meant to be used from these twin screen machines, which will have known configurations. It...
13
3340
by: Geoff Fox | last post by:
I am in the final moments of designing a new website. One of the pages (http://www.auditionfactory.com/samples.php) has four links to show sample work. I would like these links to open new browser windows when clicked. I have found scripts that will allow one to open, and a few that claim to all multiples to be opened, but so far nothing that will allow a user to open multiple new windows as they click to see new samples. Does anyone...
1
3480
by: dnes | last post by:
Open Multiple New Browser Windows from ASP.NET I'm having trouble figuring out how to open multiple new browser windows (each one displaying something different). As you can see from the code below, I have one ASP.NET page that has a foreach loop, and inside this foreach loop, I was to spawn a new browser window using the second ASP.NET page. This doesn't work. Only the last time through the foreach loop causes a new browser window...
1
1281
by: Visitbazaar Info | last post by:
-- Internet - Take Advantage of Multiple Windows When Surfing SUMMARY: Stop jumping back and forth between index pages by using several browser windows. Why use one web browser window when you can have multiple? If you have an adequate amount of memory, open up several web browsers to maximize your surfing experience. One great way to do this is via a start page. Select a page from where you
0
9596
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
10617
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10364
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
7649
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
6876
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4328
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3849
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
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.