www.webdeveloper.com
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2011
    Posts
    49

    Close f4 not working

    I'm not sure what is going on here and why my F4 prevent not working. I have a close option btw.

    Code:
    window.onload = function document.onkeydown()
    {
    if ( 
    (event.keyCode == 116) || (event.keyCode == 122) || 
    ((event.ctrlKey) && ((event.keyCode == 82))) ||
    ((event.ctrlKey) && ((event.keyCode == 67))) ||
    ((event.altKey) && ((event.keyCode == 115)))
    )
    {
    event.keyCode = 0;
    event.cancelBubble = true;
    return false;
    }
    }

  2. #2
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,427
    Some of the keys combinations can not be prevented. They are part of the Operating System. Like, in Windows, ALT+F4, CTRL+ALT+DELETE, etc... They suppose to overpass everything (to work asynchronously) just in order to stop a crush process, etc.

Thread Information

Users Browsing this Thread

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

     

Bookmarks

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