onkeydoen doesn't wark in firefox 9 & safari for win

Discussion in 'JavaScript' started by lior_lahav, Jan 5, 2012.

  1. #1
    the next code work perfect in IE6-9, chrome, opera, firefox2,3,3.6,4,5,6 but doesnt work in firefox 9 and safari for windows.U can see it on http://www.hlahav.co.il/gallery.htm in the litebox of the photoshtml
    Code (markup):
    js
    function escape(event,dont) { var keyCode = (event.which) ? event.which : event.keyCode;	if(keyCode==27){	endimg();	           }	           if (dont == undefined) {	               if (keyCode == 37) {	                   next();	               }	               if (keyCode == 39) {	                   beck();	               }	           } }
    Code (markup):

     
    lior_lahav, Jan 5, 2012 IP
  2. lior_lahav

    lior_lahav Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    the next code work perfect in IE6-9, chrome, opera, firefox2,3,3.6,4,5,6 but doesnt work in firefox 9 and safari for windows.U can see it on [link]http://www.hlahav.co.il/gallery.htm[/link] in the litebox of the photos[br]JS code: function escape(event,dont) { var keyCode = (event.which) ? event.which : event.keyCode; if(keyCode==27){ endimg(); } if (dont == undefined) { if (keyCode == 37) { next(); } if (keyCode == 39) { beck(); } } }
     
    lior_lahav, Jan 5, 2012 IP
  3. ScottAN

    ScottAN Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    onkeydown works with all major browsers. If you are having problems in FireFox you should install the add-on called Firebug and see what errors it gives you.

    Provide text from an error log please.
     
    ScottAN, Jan 5, 2012 IP