Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Javascript (http://www.velocityreviews.com/forums/f68-javascript.html)
-   -   Javascript popup window refresh'ing? (http://www.velocityreviews.com/forums/t877481-javascript-popup-window-refreshing.html)

Jeppe bob Dyrby 05-20-2004 07:48 PM

Javascript popup window refresh'ing?
 
I have a page that automaticly opens a small popup window, but it is
only supposed to open this window once. A little info:

function openwindow(name_var) {
if (!name_var) {
name_var = window.open(...);
}
}

First of: Is that at all posible? To have a variable that holds the
name of the new window, and if that variable is not set, then open the
window, and will the new window opened have the name of the content of
the variable (confused? so am I)...

OR:

Can I, in the new window, do so it is imposible to refresh that
window, 'cause it refreshes when the top function tries to open it
again...?

Hope this was enough info, otherwise I'd be glad to write some more...

Hopefully I can get som help on this topic.

Thank's in advance.

- Jeppe

Camazing.com 05-21-2004 03:04 AM

Re: Javascript popup window refresh'ing?
 
Not exactly sure what your asking, but if you have a window open and then
open another window with the same name, it will put the new page in the
window with the same name . If there is not a window with that name, it will
create a new one.

"Jeppe bob Dyrby" <jeppe@yfu.dk> wrote in message
news:b58e3ae3.0405201148.81f5cdf@posting.google.co m...
> I have a page that automaticly opens a small popup window, but it is
> only supposed to open this window once. A little info:
>
> function openwindow(name_var) {
> if (!name_var) {
> name_var = window.open(...);
> }
> }
>
> First of: Is that at all posible? To have a variable that holds the
> name of the new window, and if that variable is not set, then open the
> window, and will the new window opened have the name of the content of
> the variable (confused? so am I)...
>
> OR:
>
> Can I, in the new window, do so it is imposible to refresh that
> window, 'cause it refreshes when the top function tries to open it
> again...?
>
> Hope this was enough info, otherwise I'd be glad to write some more...
>
> Hopefully I can get som help on this topic.
>
> Thank's in advance.
>
> - Jeppe




Jeppe bob Dyrby 05-21-2004 09:39 AM

Re: Javascript popup window refresh'ing?
 
Hmm... I wasn't totally clear then :p
Is there any way to stop the browser from openening a popup with the
same name as one that already exists?
If, for example: The opener window tries to open a popup window, but
there's already one with the same name, as the one it tries to open,
can I stop it from openening the same page in the same popup window?

- Hope that was a bit more info... :)
- Jeppe

"Camazing.com" <nobody@camazing.com> wrote in message news:<QuOdnZngB5lD7DDd4p2dnA@adelphia.com>...
> Not exactly sure what your asking, but if you have a window open and then
> open another window with the same name, it will put the new page in the
> window with the same name . If there is not a window with that name, it will
> create a new one.


Richard Cornford 05-21-2004 11:32 AM

Re: Javascript popup window refresh'ing?
 
Jeppe bob Dyrby wrote:
> Hmm... I wasn't totally clear then :p
> Is there any way to stop the browser from openening a popup with the
> same name as one that already exists?


Broadly no, in a practical sense, yes. That is, if you opened the
windows and gave them names then you are in a potion to record what you
have done and examine the references to those windows to see if they
have been closed or are still open, and make decisions about how to act
based on that information. However, if a window with an identical name
has already been created (say by a previous page/site) then you will not
know anything about it (and probably won't care much either).

> If, for example: The opener window tries to open a popup window, but
> there's already one with the same name, as the one it tries to open,
> can I stop it from openening the same page in the same popup window?


Yes.

> - Hope that was a bit more info... :)


It is more information, but whether it is enough information is another
matter. People write code to specifications, which are specific. If you
want to be told how to do something you will have to try to be specific
about what it is you want to do (and probably why). As it is, we get to
the point of determining that a window with a given name has been opened
and a URL loaded, and determine that it is still open, and so "stop it
from openening the same page in the same popup window", but does that
mean that the code is expected to just do nothing, or is the idea to
open a new URL in a distinct window?

But opening pop-up windows is not necessarily that good an idea to start
with due to the existence of diverse pop-up blocking mechanisms. Some
idea of the context of the application would allow for an assessment of
the significance of pop-up blocking (and accompanying required
additional testing) along with the proposition of alternative
approaches.

<snip top-post>

Please don't top post to comp.lang.javascirpt (see the FAQ).

Richard.




All times are GMT. The time now is 07:35 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.