Javascript popup window refresh'ing?

Discussion in 'Javascript' started by Jeppe bob Dyrby, May 20, 2004.

  1. 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, May 20, 2004
    #1
    1. Advertising

  2. Jeppe  bob  Dyrby

    Camazing.com Guest

    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" <> wrote in message
    news:...
    > 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, May 21, 2004
    #2
    1. Advertising

  3. 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" <> wrote in message news:<>...
    > 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, May 21, 2004
    #3
  4. 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.
     
    Richard Cornford, May 21, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?T3Bh?=

    How to refresh calling window from a popup window

    =?Utf-8?B?T3Bh?=, Jun 13, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    15,082
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Jun 14, 2006
  2. Simon Wigzell
    Replies:
    4
    Views:
    313
    Simon Wigzell
    Sep 15, 2003
  3. Jens Peter Hansen
    Replies:
    7
    Views:
    566
    Randy Webb
    Jun 19, 2004
  4. Raffi
    Replies:
    4
    Views:
    243
    Dr John Stockton
    Aug 12, 2004
  5. Jimmy
    Replies:
    1
    Views:
    329
    Thomas 'PointedEars' Lahn
    Oct 6, 2007
Loading...

Share This Page