Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > meaning of statement "window.opener = top;"

Reply
Thread Tools

meaning of statement "window.opener = top;"

 
 
Matt
Guest
Posts: n/a
 
      07-28-2004
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!!
 
Reply With Quote
 
 
 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      07-28-2004
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
 
Reply With Quote
 
 
 
 
Matt
Guest
Posts: n/a
 
      07-30-2004
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!!
 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      07-30-2004
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
 
Reply With Quote
 
bruce
Guest
Posts: n/a
 
      07-30-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) (Matt) wrote in message news:<(E-Mail Removed) om>...
> 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.
 
Reply With Quote
 
Grant Wagner
Guest
Posts: n/a
 
      07-30-2004
bruce wrote:

> (E-Mail Removed) (Matt) wrote in message news:<(E-Mail Removed) om>...
> > 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 <(E-Mail Removed)>
comp.lang.javascript FAQ - http://jibbering.com/faq

 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      07-30-2004
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Understanding search queries, semantics, and "Meaning" ...aren't weall looking for meaning? 5lvqbwl02@sneakemail.com Python 4 01-14-2009 02:28 PM
I want the meaning of this statement sam C++ 2 11-10-2006 03:38 PM
if statement that, when false, skips first statement in its block, executes second? Jay McGavren Java 11 01-16-2006 05:49 PM
How do I do a conditional statement in a constant statement? tkvhdl@gmail.com VHDL 3 12-16-2005 06:13 PM
meaning of this statement: DataSource="<%# DsBooks1 %>" peng ASP .Net 3 08-28-2004 03:24 PM



Advertisments