473,387 Members | 1,904 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,387 software developers and data experts.

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 10442
Steve <st***@hello.com> 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)cyberspace.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.com> 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.javascript 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)cyberspace.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
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.


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.javascript 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
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...
1
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...
11
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...
6
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...
1
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...
3
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...
1
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...
3
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...
2
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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,...

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.