Wrox Programmer Forums
|
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 18th, 2004, 08:40 PM
Authorized User
 
Join Date: Nov 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to avoid system msg when closing windows??

when i close my page, how to avoid the Microsoft Internet Explorer msg?

the msg is "The Web page you are viewing is trying to close the window. Do you want to close this window?

 
Old May 18th, 2004, 08:49 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

This is a little JavaScript secret....

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

Use this JS code to get what you want.

HTH,

Snib

<><
 
Old May 19th, 2004, 08:46 AM
Authorized User
 
Join Date: Nov 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks!! i will try it.

 
Old May 22nd, 2004, 09:17 AM
Authorized User
 
Join Date: Nov 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi Snib,

it really works!! but i can open the window once only.

actually wat i wanted to do on my page is
1. Open a new windows (named newWindows1) & close the "old" windows.
2. when i click <close> on the new windows (named newWindows1), another new windows (named newWindows2) open & close the newWindows1.
- this will work continuosly.

my problem is I can open & close the browser windows once only. which means
step 1. open & close
step 2. close (but without open a new windows)

So wat can i do to open a new windows in step 2?? wat happened now is in step 2, it only close and it will not open a new windows.

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

I hope I have describe my problem clear enough here.

advanced thanks for those who able to provide help.
 
Old May 22nd, 2004, 09:20 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Add an onunload attribute to the body tag like this:

<body onunload='openWin()'>
<script language=javascript>
function openWin()
{
 window.open('yourpage.php');
}
</script>

HTH,

Snib

<><





Similar Threads
Thread Thread Starter Forum Replies Last Post
avoid self closing tag in xml vinodcprm XSLT 2 July 29th, 2008 04:20 AM
system.stackoverflowexception in system.windows.fo scheidel21 Pro VB.NET 2002/2003 2 May 18th, 2007 12:40 AM
windows app for closing my pc exarkuun General .NET 3 July 25th, 2005 01:31 PM
Avoid Warning Message on C lose Windows qazi_nomi Javascript 9 September 11th, 2004 11:19 AM
How to Avoid PopUp Windows when link to a file? Dragonist HTML Code Clinic 3 July 29th, 2004 08:43 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.