473,396 Members | 1,836 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 19223
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Pack Fan | last post by:
I've noticed that session variables will persist on Mac IE even after all browser windows have been closed. One must quit the program to clear the session variables. This presents a security risk...
2
by: Simon Fletcher | last post by:
Hello there, I need a "Close Window" script ( onLoad.Close.Window() ), however i need the script so it don't come up with this annoying window: "This window is trying to close" window. Is...
9
by: Graham | last post by:
What I currently have is a page that opens another browser at 800x600, once that is loaded I would like to close the orginal page down while keeping the page that it has just opened open (To make...
6
by: chon | last post by:
I have an ASP page that is sent a file location as a parameter. It opens this file, loads the ADODB.Stream object and does a binary write to the page forcing the download dialog to appear. This...
3
by: Isabel | last post by:
How can you close all child browser windows that where open by a parent browser window? I have links on a parent (main) page that opens the child page as a separate browser. However, I need to be...
4
by: Ron Lautmann | last post by:
I want to close a browser window so I created a Close button that does this: private void Button1_Click(object sender, System.EventArgs e) {...
7
by: Paul | last post by:
Hi I have a web application that has a log off selection, just redirects the browser to a form with a label displaying you are loging off. In part of the application I open a new window and was...
37
by: Jan Tovgaard | last post by:
Hey everyone:) We have a critical problem, which I can see that other people also has ran into. In Internet Explorer 7 it is no longer possible to do a window.close after opening a window,...
7
by: Toccoa | last post by:
After considerable googling - I mean searching with Google(r) - I could not find javascript on a button or <a href=... to close a window in the latest versions of IE and FireFox. There seemed...
5
by: jimmy | last post by:
Hi all, I want to capture the event when the browser's close button is clicked in an html page. I tried using the event.ClientX and event.ClientY property in the body unload event, and this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.