473,403 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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('Log1', 'win1',
config='right=0,top=60,toolbar=0,width=300,height= 300,resizable=1,scrollbars=1,location=no,status=no
');

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

Win2 = window.open('Log2', 'win2',
config='right=0,top=60,toolbar=0,width=300,height= 300,resizable=1,scrollbars=1,location=no,status=no
');

Win2.document.writeln(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 2526
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('Log1', 'win1',
config='right=0,top=60,toolbar=0,width=300,height= 300,resizable=1,scrollbars=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.writeln(yyyy + '-' + mm + '-' + dd + ' ' + hh + ':' + mn
+ ':' + ss + ',' + ms);
Win2 = window.open('Log2', 'win2',
config='right=0,top=60,toolbar=0,width=300,height= 300,resizable=1,scrollbars=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],[windowParameters]);
Win2.document.writeln(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.javascript 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
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...
3
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...
1
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 =...
2
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....
2
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...
4
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...
13
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...
1
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...
1
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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
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...

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.