Not sure of that. I do know that clicking OK will leave browser open and cancel will close it. I tested this script yesterday and here are some problems with it:
1) It only works in IE. OnBeforeUnload is not a W3 compliant event. It is a Microsoft event that few (if any) other browsers support.
2) It doesn't really work that well in IE. In my test yesterday, the only time the event was fired is when I clicked the "X" in the corner to close the browser. Going to File->Close did not trigger the event, nor did a button I created that used window.close() to close the window.
These are probably security measures put in place to prevent malicious _javascript_ from doing something before you close your browser. For instance, without such measures it would be possible to write a script that would totally prevent you from closing your browser.
| "Stephen Miles"
<[EMAIL PROTECTED]>
Sent by: [email protected] 10/19/2005 09:16 AM
|
|
Very nice – are we able to check to see if they choose the OK or Cancel button?
Stephen Miles
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED]
On Behalf Of Vincenzo Amoruso
Sent: Tuesday, October 18, 2005 2:28 AM
To: [email protected]
Subject: R: [Easy400Group] IE Closing message
.....
function HandleOnClose() {
if ((event.clientY < 0)) {
event.returnValue = 'Some data
are changed are you sure to close this page?';
}
}
......
<BODY
i hope this helps you!
Regards Vincenzo!
-----Messaggio originale-----
Da: [email protected] [mailto:[EMAIL PROTECTED]Per
conto di [EMAIL PROTECTED]
Inviato: lunedì 17 ottobre 2005 21.12
A: [email protected]
Cc: [email protected]
Oggetto: Re: [Easy400Group] IE Closing message
That message should only appear if you use a _javascript_ to close the main
browser window (ie...the window that opened when you clicked on the icon
on your desktop/start menu). Any child windows that your web site
creates should not give that message when you use .close(). Since
that message is a built in security feature to alert a user of possible
malicious _javascript_, there is no way around it.
To sum up, you should only use _javascript_ to close windows that your application
has opened using _javascript_.
| "pilepl01" <[EMAIL PROTECTED]>
Sent by: [email protected] 10/17/2005 02:50 PM
|
|
How do i get rid of the following IE message when i close a window with
self.close() or window.close():
( The webpage you are viewing is trying to close the window. Do you
want to close this window (Yes / No ) )
------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/wbFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Easy400Group/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
SPONSORED LINKS
| How to format a computer hard drive | Cobol programmer | Iseries 400 |
| How to format a computer |
YAHOO! GROUPS LINKS
- Visit your group "Easy400Group"
on the web.
- To unsubscribe from this group,
send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
| How to format a computer hard drive | Cobol programmer | Iseries 400 |
| How to format a computer |
YAHOO! GROUPS LINKS
- Visit your group "Easy400Group" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
