本文介绍了从Firefox的jQuery 1.10.2警告问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

离开这个问题可以吗?如何解决它?

解决方案

这是一个已知的问题,报告为版本1.10.2,并已解决为1.11 / 2.1 jQuery里程碑。请参阅提出的拉取请求,以及有关错误跟踪器的报告提交来解决的,看起来像这样:

  this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined&& (src.returnValue === false || src.getPreventDefault&& src.getPreventDefault())? returnTrue:returnFalse; 


I tried to use latest jQuery for my website and I get this warning sign and message from Firefox 24.

Is it fine to leave that problem? How to solve it?

解决方案

This is a known issue, reported for version 1.10.2 and has been resolved for the 1.11/2.1 jQuery milestone. See a proposed pull request here, and the report on the bug tracker here.

To fix this, just use a later version of jQuery, or change this line in event.js from:

this.isDefaultPrevented = ( src.defaultPrevented || src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;

To this line:

this.isDefaultPrevented = src.defaultPrevented ? returnTrue : returnFalse;

Edit: The pull request linked above was never merged, although it did fix the problem. The issue was instead resolved by this commit and looks like this:

this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined && ( src.returnValue === false || src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;

这篇关于从Firefox的jQuery 1.10.2警告问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 09:36