Javascript popup window refresh'ing?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeppe  bob  Dyrby

    #1

    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

    #2
    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.0 405201148.81f5c df@posting.goog le.com...[color=blue]
    > 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[/color]


    Comment

    • Jeppe  bob  Dyrby

      #3
      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.c om" <nobody@camazin g.com> wrote in message news:<QuOdnZngB 5lD7DDd4p2dnA@a delphia.com>...[color=blue]
      > 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.[/color]

      Comment

      • Richard Cornford

        #4
        Re: Javascript popup window refresh'ing?

        Jeppe bob Dyrby wrote:[color=blue]
        > 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?[/color]

        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).
        [color=blue]
        > 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?[/color]

        Yes.
        [color=blue]
        > - Hope that was a bit more info... :)[/color]

        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.javas cirpt (see the FAQ).

        Richard.


        Comment

        Working...