www.webdeveloper.com
Results 1 to 6 of 6

Thread: Question - Coding the "X" close window icon

  1. #1
    Join Date
    Mar 2006
    Posts
    45

    Question - Coding the "X" close window icon

    Hi.

    At the top right hand corner of windows explorer's browser window there is an "X" icon for closing the browser window. I would like to manipulate this icon.

    I would like to intercept the "X" icon, so that onClick a member of my site would be logged out and then the window will close. That or I'd like to send a "time out" when I click the "X" box.

    Is any of this possible?

    Any reply or advice to this question would be appreciated.

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    onunload will allow you to run a one or two line Javascript whenever someone leaves your page (not necessarily by closing their browser). This will work for about 90% of your visitors.

    onbeforeunload is non-standard and only works in some browsers so the percentage of people it will run for could be significantly lower. It too will run when someone wants to leave your page not necessarily by closing the browser.
    Stephen

  4. #4
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    onbeforeunload works in IE and FF
    At least 98% of internet users' DNA is identical to that of chimpanzees

  5. #5
    Join Date
    Mar 2006
    Posts
    45

    Thank You all

    Hi.

    Thank you all for the replies to this issue. I will try it all out.

  6. #6
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    Quote Originally Posted by Fang
    onbeforeunload works in IE and FF
    Just because something works in various browsers doesn't make it part of the standards and doesn't mean that other browsers will necessarily adopt it in the future. There are plenty of browsers around that don't support non-standard events like beforeunload.
    Stephen

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles