简体   繁体   中英

jQuery warning with event.returnVAlue is deprecated

Whenever I build a webpage with some jQuery, using version: http://code.jquery.com/jquery-1.10.2.js

I keep getting this warning every time I run the webpage through the Console on Google Chrome.

Is there a piece of code I need to prevent this from happening? NOTE: I'm in the process of learning jQuery.

event.returnValue is deprecated. Please use the standard event.preventDefault() instead.

Any help at all will be great.

Thanks in advance.

This is a known bug in JQuery 1.10.2. See the following links http://bugs.jquery.com/ticket/14599 http://bugs.jquery.com/ticket/14282

From the bug report

We are aware of the message, which is just a warning and has no effect on functionality. Note that even after the new vesion is released, older jQuery versions will continue to generate this message forever -- or until Chrome decides to remove the message.

You should find cases where you are using event.returnValue and replace it with preventDefault as suggested.

This is warning you that this method is deprecated and shoudl be replaced as it may be removed in future browser versions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM