event.returnValue是pcated德$ P $。请使用标准的事件。preventDefault(),而不是 [英] event.returnValue is deprecated. Please use the standard event.preventDefault() instead

查看:138
本文介绍了event.returnValue是pcated德$ P $。请使用标准的事件。preventDefault(),而不是的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的脚本:

<script>
$(document).ready(function () {
    $("#changeResumeStatus").click(function () {
        $.get("{% url 'main:changeResumeStatus' %}", function (data) {
            if (data['message'] == 'hidden') {
                $("#resumeStatus").text("скрыто");
            } else {
                $("#resumeStatus").text("опубликовано");
            }
        }, "json");
    });
});
</script>

我收到我的谷歌浏览器的控制台以下错误:

I receive the following error in my Google Chrome console:

event.returnValue是pcated德$ P $。请使用标准的事件。preventDefault()代替。

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

我使用jQuery的v1.10.2和 #changeResumeStatus &LT;跨度&GT;

I am using jQuery v1.10.2 and #changeResumeStatus is a <span>.

有什么毛病我的脚本?

推荐答案

这只是一个警告:您的code仍然有效,但可能不会在今后的工作为手段pcated德$ P $。请参阅<一href="https://$c$c.google.com/p/chromium/$c$csearch#chromium/src/third_party/WebKit/Source/core/frame/UseCounter.cpp&q=event.returnValue%20de$p$pcated&sq=package%3achromium&type=cs&l=673">relevant铬和<源href="http://src.chromium.org/viewvc/blink/trunk/Source/core/frame/UseCounter.cpp?revision=156916">corresponding修补。

This is only a warning: your code still works, but probably won't work in the future as the method is deprecated. See the relevant source of Chromium and corresponding patch.

这已经被承认和固定的jQuery 1.11(见这里和的here )。

This has already been recognised and fixed in jQuery 1.11 (see here and here).

这篇关于event.returnValue是pcated德$ P $。请使用标准的事件。preventDefault(),而不是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆