473,406 Members | 2,849 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,406 software developers and data experts.

Closing a web Page

Hi Everyone
im trying to close a window using "window.close()"
but it send a message dialog before closing the web page says :
"The Web Page you are viewing is trying to close the window, do you want it
to close this window?"
is there any solutions so that message dialog doesent appear & the web page
close immediatly???
Regards
Nov 18 '05 #1
6 5996
if you want to close a window using this method , you have to open it before
using window.open
otherwise you will get this message.In other words , you can only close
child windows that you have opened.

for example try this :

window.open("1.htm");
in 1.htm write this :

window.close();

"Mariame" <Ma************@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi Everyone
im trying to close a window using "window.close()"
but it send a message dialog before closing the web page says :
"The Web Page you are viewing is trying to close the window, do you want it to close this window?"
is there any solutions so that message dialog doesent appear & the web page close immediatly???
Regards

Nov 18 '05 #2
It's a security feature that unables script to close a window he did not
open.

There are some walkarounds but you will have to give me first some more
details on the application:
When you close this window are there any other windows opened?


"Mariame" <Ma************@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi Everyone
im trying to close a window using "window.close()"
but it send a message dialog before closing the web page says :
"The Web Page you are viewing is trying to close the window, do you want it to close this window?"
is there any solutions so that message dialog doesent appear & the web page close immediatly???
Regards

Nov 18 '05 #3
"Mariame" <Ma************@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi Everyone
im trying to close a window using "window.close()"
but it send a message dialog before closing the web page says :
"The Web Page you are viewing is trying to close the window, do you want it to close this window?"
is there any solutions so that message dialog doesent appear & the web page close immediatly???


Try this:

"window.opener=null;window.close();"
Nov 18 '05 #4
Thx for ur reply
i want to close the main page & it wasnt open using "window.open()"
and there isnt another opened windows.
is there is another way to close the window using asp.net instead of using
scripts????
Thx & Regards
"Mr. Dot Net" <Do@Not.Spam> wrote in message
news:uG**************@TK2MSFTNGP09.phx.gbl...
It's a security feature that unables script to close a window he did not
open.

There are some walkarounds but you will have to give me first some more
details on the application:
When you close this window are there any other windows opened?


"Mariame" <Ma************@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi Everyone
im trying to close a window using "window.close()"
but it send a message dialog before closing the web page says :
"The Web Page you are viewing is trying to close the window, do you want

it
to close this window?"
is there any solutions so that message dialog doesent appear & the web

page
close immediatly???
Regards


Nov 18 '05 #5
Hi,

Any user-opened window will show that prompt (and cannot suppress it). Only
script-opened (window.open) windows will close silently.

"Mariame" <Ma************@yahoo.com> wrote in message
news:#N**************@TK2MSFTNGP11.phx.gbl...
Hi Everyone
im trying to close a window using "window.close()"
but it send a message dialog before closing the web page says :
"The Web Page you are viewing is trying to close the window, do you want it
to close this window?"
is there any solutions so that message dialog doesent appear & the web page
close immediatly???
Regards

Nov 18 '05 #6
no, here are the only ways I know of

use javascript to automate it..or
user clicks "close" in browser window.
user unplugs computer

"Mariame" <Ma************@yahoo.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl...
Thx for ur reply
i want to close the main page & it wasnt open using "window.open()"
and there isnt another opened windows.
is there is another way to close the window using asp.net instead of using
scripts????
Thx & Regards


"Mr. Dot Net" <Do@Not.Spam> wrote in message
news:uG**************@TK2MSFTNGP09.phx.gbl...
It's a security feature that unables script to close a window he did not
open.

There are some walkarounds but you will have to give me first some more
details on the application:
When you close this window are there any other windows opened?


"Mariame" <Ma************@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi Everyone
im trying to close a window using "window.close()"
but it send a message dialog before closing the web page says :
"The Web Page you are viewing is trying to close the window, do you want

it
to close this window?"
is there any solutions so that message dialog doesent appear & the web

page
close immediatly???
Regards



Nov 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: James | last post by:
Quick question about closing recordsets and connection objects. We're in the process of rewriting a TON of bad code. None of it is even remotely tabbed properly, it's impossible to read half the...
3
by: Daniel | last post by:
Is there a way to make a javascript do something when the user closes the browser? I would like it to go another url or something. I do not want this script to run when a user clicks on a link on...
1
by: MJEASSOC | last post by:
I need some help with closing a popup window. I'm making an online portfolio, that has one base page with text and thumbnails. When a user clicks on a thumb, a new window opens containing a larger...
10
by: Tom Szabo | last post by:
Is there an event when that triggers when the window is closing.... I am talking about when the user clicks on the cross on the right top corner of the window!!!
6
by: Al the programmer | last post by:
I want to catch the Closing event for my form. I created a test windows app using the wizard. I then create the Closing event by clicking the lightning bolt on the properties pane. The code is...
13
by: Simon Harvey | last post by:
Hi All, I have a colleague that I wprk with that develops using ASP. I develop using ASP.net. He seems to make sites much faster than me and I am wondering if its because of the two different...
5
by: Russell | last post by:
Hi all, I have a web page(a) that has a link to another web page(b). Now, on the page load event of web page(b), I am doing the following: Response.redirect("./test.pdf") This pdf, if the...
2
by: sylvain | last post by:
is there a simple way to detect a web window closing when the user hit the X of the browser ? I want to display a message to the user when he goes out of my web page. I try to detect it by using...
7
by: Martien van Wanrooij | last post by:
I have been faced a couple of times with the situation that I wanted to write a script and was worried about a too frequent opening and closing mysql connections. To give some examples: 1)I...
2
by: ting ting | last post by:
I am using the ASP.net 2.0 and When I load a page, it will auto pop up the Reminder page by following showModalDialog Javascript. It worked fine for the first time, after I amended some data and...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.