I understand, but it is better than what I have running now (no detection of browser closing).  As for your problems:

 

  1. At lease it works in IE which is the majority of browsers
  2. It worked for be when the X was clicked or the url was changed

 

If you figure anything else out, please let me know.  And Thanks for your help.

 

Stephen Miles

 

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent:
Wednesday, October 19, 2005 10:03 AM
To: [email protected]
Subject: RE: [Easy400Group] IE Closing message

 


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

Please respond to
[email protected]

To

<[email protected]>

cc

 

Subject

RE: [Easy400Group] IE Closing message

 

 

 




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

 

Please respond to
[email protected]

 

To

[email protected]

cc

 

Subject

[Easy400Group] IE Closing message

 

 

 

 




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

 

 


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.

 


 

 



SPONSORED LINKS
How to format a computer hard drive Cobol programmer Iseries 400
How to format a computer


YAHOO! GROUPS LINKS




Reply via email to