csdnceshi62 2013-11-18 10:12 采纳率: 100%
浏览 545
已采纳

不推荐使用 returnvalue。 请使用标准 event.preventDefault ()代替

I have this script:

<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 is deprecated. Please use the standard event.preventDefault() instead.

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

What's wrong with my script?

转载于:https://stackoverflow.com/questions/20045162/event-returnvalue-is-deprecated-please-use-the-standard-event-preventdefault

  • 写回答

7条回答 默认 最新

  • derek5. 2013-11-18 10:27
    关注

    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.

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(6条)

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘