473,569 Members | 2,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Close page after it loads?

Is it possible to close a page using Javascript that will close *after* the
page is loaded (it's an ASP page that performs an action).
Sep 16 '05 #1
5 10448
Steve <st***@hello.co m> wrote:
Is it possible to close a page using Javascript that will close *after* the
page is loaded (it's an ASP page that performs an action).


<html>
<head>
<script>
function ready() {
window.close();
}
</script></head>
<body onload="ready() ;">
</body></html>

? Insert whatever actions you need to perform before window.close().

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cybers pace.org | don't, I need to know. Flames welcome.
Sep 16 '05 #2
Christopher Benson-Manica said the following on 9/16/2005 12:04 PM:
Steve <st***@hello.co m> wrote:

Is it possible to close a page using Javascript that will close *after* the
page is loaded (it's an ASP page that performs an action).

<html>
<head>
<script>
function ready() {
window.close();
}
</script></head>
<body onload="ready() ;">
</body></html>

? Insert whatever actions you need to perform before window.close().


"Script is attempting to close the page......."

And yes, I can make IE close a window that script didn't open. The
Unconditional Truth will set you free if you search the archives for it.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Sep 16 '05 #3
Randy Webb <Hi************ @aol.com> wrote:
And yes, I can make IE close a window that script didn't open. The
Unconditional Truth will set you free if you search the archives for it.


Hm, I see, although it seems that defeating protection offered by the
browser should be done with care.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cybers pace.org | don't, I need to know. Flames welcome.
Sep 16 '05 #4
Christopher Benson-Manica said the following on 9/16/2005 1:22 PM:
Randy Webb <Hi************ @aol.com> wrote:

And yes, I can make IE close a window that script didn't open. The
Uncondition al Truth will set you free if you search the archives for it.

Hm, I see, although it seems that defeating protection offered by the
browser should be done with care.


Whether that protection is offered by the browser is debatable though.
Mozilla based browsers do not allow it, in any form. Other browsers do,
and IE does it back to at least IE5.0/Win so it's hard to claim it as a
bug, and if it's not a bug then it's an undocumented feature. And IE is
not the only browser that does it.

So, if a browser intentionally allows you to do it, then how is that
browser safeguarding against it?

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Sep 16 '05 #5
Steve wrote:
Is it possible to close a page using Javascript that will close *after*
the page is loaded (it's an ASP page that performs an action).


Why not have the ASP page return a 204 response instead?
http://www.w3.org/Protocols/rfc2616/...html#sec10.2.5

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Sep 16 '05 #6

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

Similar topics

4
25008
by: Andras Gilicz | last post by:
Hi VB fans I'm working on a relatively large project in VB6 with about a dozen forms, including graphs, labels, text boxes, etc. The software itself is actually a flow simulator with more or less complex technical calculations, several input variables. I would like to equipp the starting panel with the usual New, Open, Save, Save As, Close...
1
1844
by: CST | last post by:
Hi All, I have a "Digital Dashboard" that basically has 4 IFrame sections. The page flows in the following order: Messages, Stocks, Weather, User Links. Please note that this order needs to stay that way. Everything but the Stocks section is pulled from our dB. I am using the server control InetCtls.Inet to obtain the stock data from...
11
2936
by: JSjones | last post by:
when a form is submitted from the main window i want a pop up window to open from the onclick event. i have that working, now how can i close the pop up window from the main window after the main window finishes loading? i've been racking my brain on this for the last two days. here is the code for the parent window that i have been testing...
6
8511
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 all works fine. If the user selects "Open" or "Cancel", the window closes, which is the desired behavior. If they select "Save", the location dialog...
1
3715
by: Marshall Dudley | last post by:
I have an application where in a shopping cart checkout a popup appears which suggests other items that may go with what was ordered with a button to add these items to the cart. When the button in the popup is clicked, the popup should present an added items to cart message, close, and reload the parent window, so the parent will show the...
3
1687
by: mcyi2mr3 | last post by:
Hi all I'm new to javascript and im trying to add a close button function to my certain pages of my site. I use this code: <a href='javascript:window.close();'>Close Window</a> to create a hyperlink which closes the window. However with pages which display data retrieved from a database using PHP i use a form to submit a search on the...
1
1485
by: mark | last post by:
Hi I am trying to count the number of times a page loads. When I hit the submit button I can get the page to count once using ispostback to check . I am trying to incriment a variable everytime the page loads. It will only do it one time even if I put the variable = variable + 1 statement into the button click event. Any ideas as to how...
3
9819
by: Joris De Groote | last post by:
Hi, I use Adobe Acrobat to read tekst from PDF files. After that the file has been read, I move the file in a folder (using the date I got from the text I got from Acrobat). Now here is my problem. When I want to move the file, I get an error stating: System.IO.IOException: The process cannot access the file...
2
1880
by: mikeJS | last post by:
Hi I was not sure where to post this as it is an asp page basicaly i am using an asp page to send data from a flash form to MS access DB however when the data is sent the asp page loads as a blank page is there a way for it to auto close after it sends the data this is the asp <%@language = "VBScript" %> <%
0
7698
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7673
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7970
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5513
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.