Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: Mon, 11 Jul 2005 01:57:06 -0700,    group: microsoft.public.inetsdk.programming.html_objmodel        back       


How to close web page without any alart?   
I use window object with close method to close a web page, this web page is 
designed by active server page and VBscript. the code is as follows:
window.close()
however, an alart messege comes from IE. It's details: The Web page you are 
viewing is trying to close the windows. Do you want to close this windows?
I want to directly close the window without any alart messege. In VBA, we 
can add a declare Application.displayalart =false. 
How to do this in html or VBA?
Thanks.


-- 
Developer
QA Dashboard
Microsoft China Development Centre
date: Mon, 11 Jul 2005 01:57:06 -0700   author:   Microlong®

Re: How to close web page without any alart?   
"MicrolongR"  wrote in message
news:4035E949-9EC7-4FF2-BC4C-97A2C688269A@microsoft.com
> I use window object with close method to close a web page, this web
> page is designed by active server page and VBscript. the code is as
> follows: window.close()
> however, an alart messege comes from IE.

Normally, only a window explicitly opened with window.open() can be 
closed with window.close() without a warning. Usually it is not a good 
idea for a page to close the browser that the user opened manually.

If you insist on annoying your users, there is a workaround that appears 
to work on all IE versions:

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

-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Mon, 11 Jul 2005 07:08:46 -0400   author:   Igor Tandetnik

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us