0

I was using 1.7.1 jquery version and trying to bind keyup event on the form field so it will likely to the modern style validation. However in the chrome and firefox works fine but not Internet Explorer. Any suggestion or fixes on this issue?

My code:

$("#profile_email").keyup(function(){
   //Tried for alert like this alert("asdasd"); and no response

   //My ajax job starts here
}
George Stocker
  • 57,289
  • 29
  • 176
  • 237
Eric T
  • 1,026
  • 3
  • 20
  • 42

2 Answers2

2

Found the problem, console.log can't handle in IE which will throw the error back.

Eric T
  • 1,026
  • 3
  • 20
  • 42
1

you should show your code to identify the issue. if you are using some code like this, then the following might be the issue!

$('document').keypress(function(e){
 switch (e.which) {
    case 40:
        alert('down');
        break;
    case 38:
        alert('up');
        break;
    case 37:
        alert('left');
        break;
    case 39:
        alert('right');
        break;
    default:
        alert('???');  
        }      
});

e.which doesn't work in IE try e.keyCode, also you probably want to use keydown() instead of keypress() if you are targeting IE.

See http://unixpapa.com/js/key.html for more information.

Vivek S
  • 5,384
  • 8
  • 51
  • 72
  • I can't use keypress because I have to capture the field input where keypress is triggering when "key pressed" like keydown – Eric T Oct 22 '12 at 03:59