如何使用 $.ajax post 方法发送,将其更改为 $.ajax post with promises (.then) 以便在找不到文件时也输出,例如,console.log("error")
$.ajax({
url: 'data.php',
type: 'POST',
data: {jsonMy: arr , fileName: 'data.json'},
dataType: 'html',
success: function(msg) {
text.innerHTML += JSON.stringify(arr);
}
});
这是一个例子
$.ajax:这是一个例子
fetch: