window.event.clientX is a positive number in IE7, but is a negative number in IE6

Discussion in 'Internet Explorer' started by Alper TEMEL, Nov 29, 2006.

  1. Alper TEMEL

    Alper TEMEL Guest

    Hi,

    I have a strange problem.



    When I close the IE window by clicking up-right X button, The value of
    window.event.clientX changes a positive number in IE7, but is a negative
    number in IE6



    This issue causes some problems on our applications.

    Steps to reproduce:

    1. Save following code as htm file and open with IE7 (if need "Allow blocked
    content")
    2. close the IE window by clicking up-right X button

    <html>
    <head>
    <title>Untitled Page</title>
    </head>
    <body>
    Please close the browser window by pressing the X button at upper right
    most corner.
    <p>
    The value of window.event.clientX is a positive number in IE7, but is a
    negative number in IE6...
    </body>
    <script type='text/javascript' language='JavaScript'>
    function doUnload()
    {
    alert("This is the value of window.event.clientX in IE7: " +
    window.event.clientX + "\n But this value was negative in IE6" );
    }

    window.attachEvent( "onunload",doUnload);
    </script>
    </html>



    Thanx
     
    Alper TEMEL, Nov 29, 2006
    #1
    1. Advertisements

  2. Alper TEMEL

    Alper TEMEL Guest

    by the way

    this script (window.event.clientX) is used to determine browser is closed or
    refreshed.
    window.event.clientX < 0 means that browser is closed

    window.event.clientX > 0 means that browser is navigated to other page/page
    refreshed
     
    Alper TEMEL, Nov 29, 2006
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.