Use of getPreventDefault() is deprecated. Use defaultPrevented instead. Why I'm getting this error and what's the solution for it?

后端 未结 4 1570
忘了有多久
忘了有多久 2021-02-11 22:44

Previously I was using jQuery 1.7.1 in my code. I was getting the above error. Then I used the jQuery 1.11.1 straight from the google repository



        
4条回答
  •  情歌与酒
    2021-02-11 23:08

    I get this error with PHPStorm debugging with Firefox 2.8 when using jQuery, currently jquery-2.0.2.min. On examining the file, it contains the following statement:

    this.isDefaultPrevented=e.defaultPrevented||e.getPreventDefault&&e.getPreventDefault()?U:Y
    

    if you change this to:

    this.isDefaultPrevented=e.defaultPrevented?U:Y
    

    the warning stops.

提交回复
热议问题