473,799 Members | 2,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Closing a window

I am creating HTML documents that have the same structure as shown
below. As a convenience to the user, I wanted to simply put a button
on the bottom of the page to close the window. However, since the
window is not created by a script, the onclick command does not work.
These files are simply meant to be clicked on by the user and
displayed in their browser of choice. Any suggestions?

Kevin Partin

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html">
<title>Eigenval ue Summary Table</title>
<style type="text/css">
<!--

h1 {
font-family: arial,helvetica ,sans-serif;
font-size: large;
font-weight: bold;
text-align: center;
}

subtitle {
font-family: arial,helvetica ,sans-serif;
font-size:small;
font-weight: bold;
text-align: center;
}

* {
font-family: courier new,courier,mon ospace;
}

-->
</style>
</head>
<body>
<h1>Real Eigenvalue Summary Table</h1>
<table border="1" cellspacing="0" align="center"
style="width: 80%; text-align: right;"
title="Real Eigenvalue Summary Table" cols="4">
<tbody>
<tr style="text-align: center;">
<td style="font-family: arial,helvetica ,sans-serif;">Mode</td>
<td style="font-family:
arial,helvetica ,sans-serif;">Eigenva lue</td>
<td style="font-family:
arial,helvetica ,sans-serif;">Radians </td>
<td style="font-family: arial,helvetica ,sans-serif;">Cycles</td>
</tr>
<tr>
<td>1</td>
<td>2.0</td>
<td>2.0</td>
<td>2.0</td>
</tr>
</tbody>
</table>
<hr align="left" noshade size="1px" width="100%">
<form style="text-align: center;">
<input type="button" value="Close"
onclick="window .close()" style="font-family:
arial,helvetica ,sans-serif;">
</form>
</body>
</html>
Jul 23 '05 #1
7 2147
Kevin Partin wrote:
I am creating HTML documents that have the same structure as shown
below. As a convenience to the user, I wanted to simply put a button
on the bottom of the page to close the window. However, since the
window is not created by a script, the onclick command does not work.
These files are simply meant to be clicked on by the user and
displayed in their browser of choice. Any suggestions? <input type="button" value="Close"
onclick="window .close()" style="font-family:
arial,helvetica ,sans-serif;">


Personally, I would learn to come to grips with the "limitation s" of
javascript.
The reason that browsers are reluctant to close the main window is that
is a poor ui technique, and it often leaves the user confused.
Mick
Jul 23 '05 #2
On 6 May 2004 08:16:44 -0700, Kevin Partin
<Ke************ @Alumni.UTexas. net> wrote:
I am creating HTML documents that have the same structure as shown
below. As a convenience to the user, I wanted to simply put a button
on the bottom of the page to close the window. However, since the
window is not created by a script, the onclick command does not work.
These files are simply meant to be clicked on by the user and
displayed in their browser of choice. Any suggestions?


Please read the FAQ, especially:

<URL:http://jibbering.com/faq/#FAQ4_14>

[snip]

Mike

--
Michael Winter
M.******@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 23 '05 #3
Michael Winter wrote:
On 6 May 2004 08:16:44 -0700, Kevin Partin
<Ke************ @Alumni.UTexas. net> wrote:
I am creating HTML documents that have the same structure as shown
below. As a convenience to the user, I wanted to simply put a button
on the bottom of the page to close the window. However, since the
window is not created by a script, the onclick command does not work.
These files are simply meant to be clicked on by the user and
displayed in their browser of choice. Any suggestions?

Please read the FAQ, especially:

<URL:http://jibbering.com/faq/#FAQ4_14>


And then know that it is technically incorrect close to 90% of the time?

No, I don't want to get into a debate about whether I can/should close a
window. Its bad design, but it doesn't change the truth.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Jul 23 '05 #4
Michael Winter wrote:
On 6 May 2004 08:16:44 -0700, Kevin Partin
<Ke************ @Alumni.UTexas. net> wrote:
I am creating HTML documents that have the same structure as shown
below. As a convenience to the user, I wanted to simply put a button
on the bottom of the page to close the window. However, since the
window is not created by a script, the onclick command does not work.
These files are simply meant to be clicked on by the user and
displayed in their browser of choice. Any suggestions?

Please read the FAQ, especially:

<URL:http://jibbering.com/faq/#FAQ4_14>

[snip]

Mike

Some browsers will close the window under some circumstances, the FAQ
fails to address the consequences of closing the main window, rather the
FAQ categorically states that it is not possible.
Mick
Jul 23 '05 #5
On Thu, 06 May 2004 16:13:41 GMT, Mick White
<mw******@BOGUS rochester.rr.co m> wrote:

[snip]
Some browsers will close the window under some circumstances, the FAQ
fails to address the consequences of closing the main window, rather the
FAQ categorically states that it is not possible.


I realise that (I know the hack), but what exactly is the point in
relaying the existance of a browser flaw to achieve something that
shouldn't be attempted anyway? Particularly if it doesn't work with all
browsers.

Closing the window via a link or button doesn't provide convenience, just
an alternative way to do something that you could already do three other
ways. Users know about the button in the title bar (that is, the X in
Windows and KDE). Most will know about an exit option in the File menu.
Some will also know about the Alt+F4 keystroke. An application specific
way is not expected and completely unnecessary. Why encourage it?

Mike

--
Michael Winter
M.******@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 23 '05 #6
Michael Winter wrote:
On Thu, 06 May 2004 16:13:41 GMT, Mick White
<mw******@BOGUS rochester.rr.co m> wrote:

[snip]
Some browsers will close the window under some circumstances, the FAQ
fails to address the consequences of closing the main window, rather
the FAQ categorically states that it is not possible.

I realise that (I know the hack), but what exactly is the point in
relaying the existance of a browser flaw to achieve something that
shouldn't be attempted anyway? Particularly if it doesn't work with all
browsers.

Closing the window via a link or button doesn't provide convenience,
just an alternative way to do something that you could already do three
other ways. Users know about the button in the title bar (that is, the X
in Windows and KDE). Most will know about an exit option in the File
menu. Some will also know about the Alt+F4 keystroke. An application
specific way is not expected and completely unnecessary. Why encourage it?

Mike


I agree with your sentiments entirely, I just have a problem with
"impossible ". It may be better to acknowledge that it can be done, for
the sake of truth, if nothing else.
Mick
Jul 23 '05 #7
Mick White wrote:
Michael Winter wrote:
On Thu, 06 May 2004 16:13:41 GMT, Mick White
<mw******@BOGUS rochester.rr.co m> wrote:

[snip]
Some browsers will close the window under some circumstances, the FAQ
fails to address the consequences of closing the main window, rather
the FAQ categorically states that it is not possible.


I realise that (I know the hack), but what exactly is the point in
relaying the existance of a browser flaw to achieve something that
shouldn't be attempted anyway? Particularly if it doesn't work with
all browsers.

Closing the window via a link or button doesn't provide convenience,
just an alternative way to do something that you could already do
three other ways. Users know about the button in the title bar (that
is, the X in Windows and KDE). Most will know about an exit option in
the File menu. Some will also know about the Alt+F4 keystroke. An
application specific way is not expected and completely unnecessary.
Why encourage it?

Mike


I agree with your sentiments entirely, I just have a problem with
"impossible ". It may be better to acknowledge that it can be done, for
the sake of truth, if nothing else.

I stopped posting the "hack" and even the path to get to it via google
(search the archives for "unconditio nal truth" and you will find it),
not because I got tired of it, but because I got tired of the "you
shouldn't do that" argument. No, you shouldn't, but it doesn't change
the fact that more and more browsers are implementing this "bug" (Yes,
its a bug). But its hard to call/believe something is a bug when its so
prevelant.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Jul 23 '05 #8

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

Similar topics

2
8896
by: Derek | last post by:
Hello: I want to capture the event when a browser is closing, to give to the user the posibility of close or no this browser. When the browser is closing, this show a confirm window with two buttons: Accept and Cancel. When press the Accept button, the browser is closing, and when press the Cancel button, the browser isn´t closing. I have tried with the event onunload, but this closes first the browser, and
10
9818
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!!!
5
2262
by: Ron L | last post by:
I have an MDI application with a number of child windows. In each child window I am catching the Closing event and having the child window decide if it should set cancel to true. The intent here is to ensure that no child window can close while it is in a state where user entered information can be lost. I have just noticed that while the Closing event is caught if I click the X on the child window, it is not caught if I click the X on...
2
2522
by: Ron L | last post by:
I have an MDI application which opens a number of child windows, each of which could have data in a state that needs to be saved. Each child window catches its Closing event and cancels it if the user wants to save the data, but when the Application closes this event isn't thrown automatically. I added a loop to close each child window, but can't seem find how to catch the child window's cancel of the Closing event, so even if the user...
4
2060
by: bbass | last post by:
thanks to all that replyied to my previous post with the following code in question: <a href="merc.htm" target="_new_merc" onfocusout=window.close class="left_link"> i understand that the people don't like the idea of closing the browser window because it's annoyance to the user
1
5825
by: Chris Bruce | last post by:
In my application I need a way to distiguish between the following events: 1. When a user closes an MDI child window. 2. When the user closes the MDI parent window which subsequently closes the MDI child window. My application does certain logic when the user actually closes the MDI child form by clicking the "X" in the upper right hand. My application, however, should not execute this logic if the user closes the MDI parent. I...
3
1934
by: Saradhi | last post by:
Hi, I wanted to stop the VS.NET Window from closing inside my C# AddIn. I Know that OnBeginShutdown() funciton will be called whenever the user tries to close the VS.NET window. I want to check some conditions and if those conditions doesnt meet, then I want to stop the VS.NET window from closing. Anybody have any diea?
10
4030
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the application. What should happen, is that the main MDI form should close, taking the child forms with it. There is code to loop through the child forms, remove the controls on each of them, and then close the form, but this code should execute only...
2
3023
by: Tom | last post by:
How is the best way to avoid validation when closing a window? For instance, I have a Windows Forms window which has a validation event for a text box. However, if one enters invalid data in then and then attempts to close the window (either via my custom 'Close' box or by clicking the close 'X' in the upper right window corner), the validation event still triggers and it tells the user that they have invalid data. Which of course means...
2
2180
by: javanet | last post by:
Hi all, 1) i opened a parent window. 2) then i opend a child window thruogh this parent window. Now i want to close child window before closing the parend window means my clients can not be close the parent window without closing the child window. please reply me. if there is any solution for this....
0
10495
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10269
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10248
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7573
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5597
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2942
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.