


第一种 :引入更高的js
第二种:使用bind

代码:
$.ajax({
type: 'POST',
url: '/welcome/wechat/send',
data: d,
success: function(data) {
console.log(data);
},
error: function(err) {
console.log(err);
}
});说明:如果发送请求的时候,断网了,那么就会直接进入err回调函数。
以上为个人经验,希望对您有所帮助。