meaning of statement "window.opener = top;"

Discussion in 'Javascript' started by Matt, Jul 28, 2004.

  1. Matt

    Matt Guest

    When I do the following, the mycode will still execute. The reason I put
    window.opener=top; is to disable the close confirmation dialog box.

    window.opener = top;
    window.close();
    //mycode...

    But if I do the following without statement window.opener = top;

    window.close();
    //mycode...

    Then mycode will not be executed.

    any ideas why? please advise. thanks!!
    Matt, Jul 28, 2004
    #1
    1. Advertising

  2. Matt wrote:
    > When I do the following, the mycode will still execute. The reason I put
    > window.opener=top; is to disable the close confirmation dialog box.


    It is using a security bug in some UAs and manipulating the
    environment of the user is at least considered bad style.

    > [...]
    > But if I do the following without statement window.opener = top;
    >
    > window.close();
    > //mycode...
    >
    > Then mycode will not be executed.
    >
    > any ideas why?


    Because you close the window and thus the global context ends.

    > please advise. thanks!!


    RTFM, RTFFAQ.


    PointedEars
    Thomas 'PointedEars' Lahn, Jul 28, 2004
    #2
    1. Advertising

  3. Matt

    Matt Guest

    Thomas wrote:

    > Matt wrote:
    > > When I do the following, the mycode will still execute. The reason I put
    > > window.opener=top; is to disable the close confirmation dialog box.

    >
    > It is using a security bug in some UAs and manipulating the
    > environment of the user is at least considered bad style.
    >


    so do you have some good suggestions? Please advise. thanks!!
    Matt, Jul 30, 2004
    #3
  4. Matt wrote:
    > Thomas wrote:
    >> Matt wrote:
    >> > When I do the following, the mycode will still execute. The reason I put
    >> > window.opener=top; is to disable the close confirmation dialog box.

    >>
    >> It is using a security bug in some UAs and manipulating the
    >> environment of the user is at least considered bad style.

    >
    > so do you have some good suggestions? Please advise. thanks!!


    Why should I support bad style? Why should I help with what can be
    considered breaking a law in some countries? Can you tell me that?


    PointedEars
    Thomas 'PointedEars' Lahn, Jul 30, 2004
    #4
  5. Matt

    bruce Guest

    (Matt) wrote in message news:<>...
    > When I do the following, the mycode will still execute. The reason I put
    > window.opener=top; is to disable the close confirmation dialog box.
    >
    > window.opener = top;
    > window.close();
    > //mycode...
    >
    > But if I do the following without statement window.opener = top;
    >
    > window.close();
    > //mycode...
    >
    > Then mycode will not be executed.
    >
    > any ideas why? please advise. thanks!!



    Matt, I might not be able to solve your problem, but i thank you
    for solving mine! The user was annoyed at the close confirmation box,
    and you just gave me a way of eliminating it. We're strictly an IE
    shop here, so hopefully it will work fine in production.

    As for this Big Ears guy, who thinks he knows exactly what every
    single user in existence needs and wants, maybe he should tell my user
    what he "really" wants and needs. People like him did great damage to
    our industry with his pompous and condescending attitude. The
    industry and this newsgroup can certainly benefit by his absence.
    bruce, Jul 30, 2004
    #5
  6. Matt

    Grant Wagner Guest

    bruce wrote:

    > (Matt) wrote in message news:<>...
    > > When I do the following, the mycode will still execute. The reason I put
    > > window.opener=top; is to disable the close confirmation dialog box.
    > >
    > > window.opener = top;
    > > window.close();
    > > //mycode...
    > >
    > > But if I do the following without statement window.opener = top;
    > >
    > > window.close();
    > > //mycode...
    > >
    > > Then mycode will not be executed.
    > >
    > > any ideas why? please advise. thanks!!

    >
    > Matt, I might not be able to solve your problem, but i thank you
    > for solving mine! The user was annoyed at the close confirmation box,
    > and you just gave me a way of eliminating it. We're strictly an IE
    > shop here, so hopefully it will work fine in production.


    It will work fine until Microsoft decides to fix the bug that allows the code to work. At which point it
    will simply stop working, and you'll be left wondering why and scrambling to figure out how to "work around
    it".

    > As for this Big Ears guy, who thinks he knows exactly what every
    > single user in existence needs and wants, maybe he should tell my user
    > what he "really" wants and needs. People like him did great damage to
    > our industry with his pompous and condescending attitude. The
    > industry and this newsgroup can certainly benefit by his absence.


    Maybe you should explain the limitations of Web-based applications more clearly to your user, explain that
    you don't have the same level of control over the client software as you do using other technologies, then
    produce a solution that is both acceptable to your client, and does not involve a hack that could
    potentially disappear with any security patch or upgrade for IE that is released.

    --
    Grant Wagner <>
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Grant Wagner, Jul 30, 2004
    #6
  7. bruce wrote:
    > [...]
    > As for this Big Ears guy,


    You do not have any sound arguments, so you think you are required
    to insult people you do not even know, and you think that distorting
    a nickname would be appropriate. Or maybe you do not think at all,
    I do not know and I care less.

    > who thinks he knows exactly what every single user in existence needs
    > and wants, maybe he should tell my user what he "really" wants and needs.
    > People like him did great damage to our industry with his pompous and
    > condescending attitude. The industry and this newsgroup can certainly
    > benefit by his absence.


    You have not the slightest clue what nonsense you have written, but
    you may still find out searching this newsgroup for numerous arguments
    about this topic and similar ones, where not only I participated but
    also other subscribers. As for your customer who most certainly wants
    to provide services to other users, but also wants the confirmation
    box which is in fact an important security feature that prevents users
    from losing their history and control over their software, removed,
    I give you and him/her one more advice to think about:

    The fish must eat the worm, not the fisher.


    PointedEars, Score adjusted
    Thomas 'PointedEars' Lahn, Jul 30, 2004
    #7
    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. Replies:
    3
    Views:
    790
  2. peng
    Replies:
    3
    Views:
    440
  3. sam
    Replies:
    2
    Views:
    289
    Victor Bazarov
    Nov 10, 2006
  4. Replies:
    4
    Views:
    742
  5. find clausen

    window.opener.top.location.top.close ???

    find clausen, Oct 5, 2003, in forum: Javascript
    Replies:
    2
    Views:
    423
    find clausen
    Oct 5, 2003
Loading...

Share This Page