Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   Close browser window. (http://www.velocityreviews.com/forums/t800417-close-browser-window.html)

MichaelK 01-13-2006 12:25 AM

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.




Ray Costanzo [MVP] 01-13-2006 12:48 AM

Re: Close browser window.
 
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" <michaelk@gomobile.com> wrote in message
news:eU03mf9FGHA.3864@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.
>
>
>




MichaelK 01-13-2006 01:22 AM

Re: Close browser window.
 
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:%23dnNYs9FGHA.2012@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" <michaelk@gomobile.com> wrote in message
> news:eU03mf9FGHA.3864@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.
>>
>>
>>

>
>




Ray Costanzo [MVP] 01-13-2006 01:46 AM

Re: Close browser window.
 
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" <michaelk@gomobile.com> wrote in message
news:%23q1jY$9FGHA.4036@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:%23dnNYs9FGHA.2012@TK2MSFTNGP14.phx.gbl...




MichaelK 01-13-2006 07:18 AM

Re: Close browser window.
 
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:%234CHsM%23FGHA.1180@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" <michaelk@gomobile.com> wrote in message
> news:%23q1jY$9FGHA.4036@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:%23dnNYs9FGHA.2012@TK2MSFTNGP14.phx.gbl...

>
>




Ray Costanzo [MVP] 01-13-2006 02:21 PM

Re: Close browser window.
 
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" <michaelk@gomobile.com> wrote in message
news:%23vWktGBGGHA.4036@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?
>



Bob Barrows [MVP] 01-13-2006 03:26 PM

Re: Close browser window.
 
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.



Larry Bud 01-13-2006 07:54 PM

Re: Close browser window.
 

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



All times are GMT. The time now is 02:36 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.