471,893 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,893 software developers and data experts.

Close browser window.

What's the best way to close current window silently after finished a
process.
I'm using the the javascritpt window.close() or top.window.close(), but it
fires a confirmation window.
Just want to close it without any confirmation, seems I done it before, but
can't find where.

Thanks,
Michael.

Jan 13 '06 #1
7 18804
This is not an ASP question, since it's all client-side stuff. One of the
things that may work in browsers today, but shouldn't in the future, is:

window.opener = window;
window.close();

Example:
<htmL>
<body>
<input type="button" onclick="closeIt(false);" value="Close with
confirmation" />
<input type="button" onclick="closeIt(true);" value="Close without
confirmation, probably" />
<script type="text/javascript">
function closeIt(b) {
if(b) { window.opener = window; }
window.close();
}
</script>
</body>
</html>

Ray at home
"MichaelK" <mi******@gomobile.com> wrote in message
news:eU**************@tk2msftngp13.phx.gbl...
What's the best way to close current window silently after finished a
process.
I'm using the the javascritpt window.close() or top.window.close(), but it
fires a confirmation window.
Just want to close it without any confirmation, seems I done it before,
but can't find where.

Thanks,
Michael.

Jan 13 '06 #2
Thanks Ray, it's closing window without confirmation, exactly what I was
looking.

Well about not an ASP question, it's how to look at it.
Based on server side process results I generate the page with different
elements
and javascritpt modules which will work on the client side.

Anyway thanks a lot, main thing you helped me.
Regards, Michael
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:%2****************@TK2MSFTNGP14.phx.gbl...
This is not an ASP question, since it's all client-side stuff. One of the
things that may work in browsers today, but shouldn't in the future, is:

window.opener = window;
window.close();

Example:
<htmL>
<body>
<input type="button" onclick="closeIt(false);" value="Close with
confirmation" />
<input type="button" onclick="closeIt(true);" value="Close without
confirmation, probably" />
<script type="text/javascript">
function closeIt(b) {
if(b) { window.opener = window; }
window.close();
}
</script>
</body>
</html>

Ray at home
"MichaelK" <mi******@gomobile.com> wrote in message
news:eU**************@tk2msftngp13.phx.gbl...
What's the best way to close current window silently after finished a
process.
I'm using the the javascritpt window.close() or top.window.close(), but
it fires a confirmation window.
Just want to close it without any confirmation, seems I done it before,
but can't find where.

Thanks,
Michael.


Jan 13 '06 #3
I understand what you're saying about the asp vs. javascript thing. It's
mostly for your benefit to post in the correct group though. While there
are many ASP experts floating around here, it's not uncommon for those
people to struggle with basic javascript, so you never know what you'll get
when you're in the wrong group.

Ray at home

"MichaelK" <mi******@gomobile.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Thanks Ray, it's closing window without confirmation, exactly what I was
looking.

Well about not an ASP question, it's how to look at it.
Based on server side process results I generate the page with different
elements
and javascritpt modules which will work on the client side.

Anyway thanks a lot, main thing you helped me.
Regards, Michael
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:%2****************@TK2MSFTNGP14.phx.gbl...

Jan 13 '06 #4
Well, I would probably do, just didn't find any good organized javascript
groups.
Have you seen any good ones by chance?

Michael.

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:%2******************@TK2MSFTNGP09.phx.gbl...
I understand what you're saying about the asp vs. javascript thing. It's
mostly for your benefit to post in the correct group though. While there
are many ASP experts floating around here, it's not uncommon for those
people to struggle with basic javascript, so you never know what you'll get
when you're in the wrong group.

Ray at home

"MichaelK" <mi******@gomobile.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Thanks Ray, it's closing window without confirmation, exactly what I was
looking.

Well about not an ASP question, it's how to look at it.
Based on server side process results I generate the page with different
elements
and javascritpt modules which will work on the client side.

Anyway thanks a lot, main thing you helped me.
Regards, Michael
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:%2****************@TK2MSFTNGP14.phx.gbl...


Jan 13 '06 #5
The one on the MS server isn't bad, it's microsoft.public.scripting.jscript.
But I believe that comp.lang.javascript is a very popular one.

Ray at home
"MichaelK" <mi******@gomobile.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Well, I would probably do, just didn't find any good organized javascript
groups.
Have you seen any good ones by chance?


Jan 13 '06 #6
MichaelK wrote:
Thanks Ray, it's closing window without confirmation, exactly what I
was looking.

Well about not an ASP question, it's how to look at it.


Just to add to what Ray said:

If what you are asking about could be applied to a .htm file, then you are
not asking about ASP.

It is to everyone's benefit to keep these newsgroups focussed.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jan 13 '06 #7

MichaelK wrote:
Well, I would probably do, just didn't find any good organized javascript
groups.
Have you seen any good ones by chance?


The one you want is

comp.lang.javascript

Jan 13 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Simon Fletcher | last post: by
9 posts views Thread by Graham | last post: by
3 posts views Thread by Isabel | last post: by
4 posts views Thread by Ron Lautmann | last post: by
37 posts views Thread by Jan Tovgaard | last post: by
5 posts views Thread by jimmy | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.