473,372 Members | 799 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,372 software developers and data experts.

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 1780
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.