学无先后,达者为师

网站首页 编程语言 正文

jquery异常问题Uncaught TypeError: $(...).on is not a function_jquery

作者:徐寿春   更新时间: 2022-12-10 编程语言

jquery异常 Uncaught TypeError: $(…).on is not a function

报错

解决办法

第一种 :引入更高的js

第二种:使用bind

jquery 捕获ajax的异常

代码:

$.ajax({
        type: 'POST',
        url: '/welcome/wechat/send',
        data: d,
        success: function(data) {
            console.log(data);
        },
        error: function(err) {
            console.log(err);
        }
    });

说明:如果发送请求的时候,断网了,那么就会直接进入err回调函数。

原文链接:https://blog.csdn.net/weixin_44550490/article/details/102603186

栏目分类
最近更新