By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,973 Members | 1,854 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,973 IT Pros & Developers. It's quick & easy.

meaning of statement "window.opener = top;"

P: n/a
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!!
Jul 23 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
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
Jul 23 '05 #2

P: n/a
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!!
Jul 23 '05 #3

P: n/a
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
Jul 23 '05 #4

P: n/a
jr********@hotmail.com (Matt) wrote in message news:<ba*************************@posting.google.c 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.
Jul 23 '05 #5

P: n/a
bruce wrote:
jr********@hotmail.com (Matt) wrote in message news:<ba*************************@posting.google.c 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 <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #6

P: n/a
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
Jul 23 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.