473,473 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

New Popup Window from an existing Popup Window

I need to do the following:

From the main page I click a link button and open a javascript popup
window. So far so good. Now when i try to open a new popup window from
a button link in the first popup window, it redirects the existing
popup window to the new URL. I need to have it open a new popup window
(of a different size) to display the new page. How can I do this?

Thanks,

Raffi
Jul 23 '05 #1
4 1782
Hello

You need to give a different window name to each popup, do this like:

// global variable
var x = 0;

window.open('theUrl.htm', 'window'+(x++), 'options here...');

--
Elias
"Raffi" <th*********@yahoo.com> wrote in message
news:fe**************************@posting.google.c om...
I need to do the following:

From the main page I click a link button and open a javascript popup
window. So far so good. Now when i try to open a new popup window from
a button link in the first popup window, it redirects the existing
popup window to the new URL. I need to have it open a new popup window
(of a different size) to display the new page. How can I do this?

Thanks,

Raffi

Jul 23 '05 #2
lallous wrote:
You need to give a different window name to each popup, do this like:

// global variable
var x = 0;

window.open('theUrl.htm', 'window'+(x++), 'options here...');
Globals are evil[tm] and in most cases not required. Besides, the global
variable is attached to the current window. If I open the popup that
contains the above code with

window.open(..., 'window1', ...')

the above statement of yours will re-use that popup anyway.
A better approach:

window.open('...', 'window' + new Date().getTime(), '...');

Since the return value of Date.prototype.getTime() changes every
millisecond, it is unlikely that an existing window will be reused.
If the return value of that method "jumps" forth/back because of
switching from/to daylight saving time, it is unlikely that a window
will be reused either because that would require thousands of named
windows to be open.
[Top post]


<http://www.jibbering.com/faq/faq_notes/pots1.html#ps1Post>
PointedEars
Jul 23 '05 #3
Thomas 'PointedEars' Lahn <Po*********@web.de> wrote in message news:<20****************@PointedEars.de>...
lallous wrote:
You need to give a different window name to each popup, do this like:

// global variable
var x = 0;

window.open('theUrl.htm', 'window'+(x++), 'options here...');


Globals are evil[tm] and in most cases not required. Besides, the global
variable is attached to the current window. If I open the popup that
contains the above code with

window.open(..., 'window1', ...')

the above statement of yours will re-use that popup anyway.
A better approach:

window.open('...', 'window' + new Date().getTime(), '...');

Since the return value of Date.prototype.getTime() changes every
millisecond, it is unlikely that an existing window will be reused.
If the return value of that method "jumps" forth/back because of
switching from/to daylight saving time, it is unlikely that a window
will be reused either because that would require thousands of named
windows to be open.
[Top post]


<http://www.jibbering.com/faq/faq_notes/pots1.html#ps1Post>
PointedEars


Thanks for the suggestions. I figured it out. I'm opening the
different windows without using too many globals, other than a couple
of variables for the popup window position.

Raffi
Jul 23 '05 #4
JRS: In article <20****************@PointedEars.de>, dated Wed, 11 Aug
2004 19:31:02, seen in news:comp.lang.javascript, Thomas 'PointedEars'
Lahn <Po*********@web.de> posted :
A better approach:

window.open('...', 'window' + new Date().getTime(), '...');

Since the return value of Date.prototype.getTime() changes every
millisecond, it is unlikely that an existing window will be reused.
If the return value of that method "jumps" forth/back because of
switching from/to daylight saving time, it is unlikely that a window
will be reused either because that would require thousands of named
windows to be open.

In the words, perhaps imperfectly quoted, of WSC - "Who is Mr Round, and
what is the basis of his objection?".
The return value of Date.prototype.getTime() is on my system zero; it
does not change.

The time resolution of a javascript date object is indeed a millisecond;
but that is not the same as the resolution of new Date() - the latter
is 10 ms in some systems, and 55 ms in some others. There may well be
systems in which its resolution is 1 ms; but an Internet author can rely
on nothing better than 55 ms (worse may be possible, of course).

The stored value represents C/UNIX time_t in milliseconds - that is
measured from 1970-01-01 00:00:00 GMT (leap seconds are ignored). It is
that stored value which is returned by getTime and valueOf. Summer Time
(Sommerzeit) is utterly irrelevant.

If the value did jump back in autumn, duplication would be
possible if a single window were opened in the hour before the
change, and a second were attempted exactly one hour later, at
the identical civil time. Thousands would not be required.

If you had made full & proper use of the newsgroup FAQ, you would have
understood these things.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> JL / RC : FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #5

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

Similar topics

5
by: Willem van Isselmuden | last post by:
Hello, I've a problem I hava a page with different popup windows, when I hit a link the first one pops up and with the first open i would like to hit the second link in the parent page so the...
2
by: Moon | last post by:
Seems I still haven't got the hang of all those window generating code in Javascript. I've got a page with about 15 photo thumbnails. When you click on a thumbnail a new window pops up which shows...
38
by: Shaun McKinnon | last post by:
HI...Here's my problem...I have a popup window that loads when i want it to, but it's not sized properly. I've set the size, but it doesn't seem to work. I've been on 8 different websites to find...
1
by: Ian Hubling | last post by:
I've spent hours adapting various scripts from this forum, but haven't been able to make anything work yet. Any help would be appreciated. What I want seems simple - which is why I can't believe...
1
by: MJEASSOC | last post by:
I need some help with closing a popup window. I'm making an online portfolio, that has one base page with text and thumbnails. When a user clicks on a thumb, a new window opens containing a larger...
23
by: Markus | last post by:
Hi, i have this problem: Sometimes, i can't reproduce, if i click on an small image on the website, the popup _AND_ an other Tab in firefox open. Here are the linkcode: <div...
3
by: clsmith66 | last post by:
I am building an ASP.NET application where I have been required to make all the editing screens popup windows within the application. I didn't have any trouble creating the new windows but only...
1
by: anandclt | last post by:
I have a web form.I am forcing a pop up from this parent form.Now I need to force a pop up from the previous pop up window. I used window.open() to force a pop up from the parent window.Now when I...
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
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,...
1
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...
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: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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...

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.