jquery.min.js?v=2.1.4:4 Uncaught TypeError: (b.contentType || "").indexOf is not a function

前台运行PUT时出现错误:jquery.min.js?v=2.1.4:4 Uncaught TypeError: (b.contentType || "").indexOf is not a function;

最后检查少了


原代码:
$.ajax({
type: 'PUT',
data: JSON.stringify(addData),
contentType:"application/json",
url: addr + "/information/update",
contentType: function () {
layerDialog = layer.msg('正在修改...',{
icon: 16, shade:0.5
});
html = "";
},

----------

改后代码:
type: 'PUT',
data: JSON.stringify(addData),
contentType:"application/json",
url: addr + "/information/update",
beforeSend: function () {
layerDialog = layer.msg('正在修改...',{
icon: 16, shade:0.5
});
html = "";
},

----------------
原文地址:https://www.cnblogs.com/daguozb/p/8376009.html