2

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.

nickhiebertdev
  • 525
  • 1
  • 6
  • 21
  • 1
    possible duplicate of [event.returnValue is deprecated. Please use the standard event.preventDefault() instead](http://stackoverflow.com/questions/20045162/event-returnvalue-is-deprecated-please-use-the-standard-event-preventdefault) – brbcoding Dec 19 '13 at 21:23
  • I don't know how to fix this. I tried adding "event.preventDefault();" to it and nothing. I want to move on. I believe there should be one line of code that fixes this. Just like basic security in php, a couple of lines does the job. Why can't jQuery get on board with a simple solution? I don't think that's asking much. – nickhiebertdev Dec 19 '13 at 23:06

2 Answers2

2

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.

Wibber
  • 41
  • 2
1

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.

Captain John
  • 1,859
  • 2
  • 16
  • 30