meaning of statement "window.opener = top;"

M

Matt

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!!
 
T

Thomas 'PointedEars' Lahn

Matt said:
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
 
M

Matt

Thomas said:
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!!
 
T

Thomas 'PointedEars' Lahn

Matt said:
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
 
B

bruce

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.
 
G

Grant Wagner

bruce said:
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.
 
T

Thomas 'PointedEars' Lahn

bruce said:
[...]
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top