开发者

jquery charcode error

开发者 https://www.devze.com 2023-01-08 18:11 出处:网络
i have this simple form validation in jquery: <script src=\"http://code.jquery.com/jquery-latest.js\"></script>

i have this simple form validation in jquery:

<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js"></script>

<script type="text/javascript">
window.onload = (function(){
  $("#register_form").validate({
   rules: {
      usernam开发者_如何学Goe: {
      required: true,
      minLength: 3
     },
     password: {
   required: true,
   minLegth: 3
     },
     password_2: {
   equalTo: "#password",
     }
  }
 });
});

</script>

If I digit a char in username I have this error in firefox javascript console (ver. 3.6.3):

"The 'charCode' property of a keyup event should not be used. The value is meaningless."

Is there any way to fix it?


Personally, I've always ignored this error...it's a result of jQuery normalizing the event (and assigning what you need to event.which), it causes no harm, and only Firebug seems to care.

0

精彩评论

暂无评论...
验证码 换一张
取 消