慕容708150
貌似是因为
没有name属性?修改如下:HTML: 发布评论JavaScript:function postComment() { var commentForm = document.getElementById('comment-form'); var formData = new FormData(commentForm); $.ajax({ method: 'POST', url: 'https://api.staticman.net/v2/entry/zaaaac/comments/master', data: formData, dataType: 'json', contentType: "application/x-www-form-urlencoded", cache: false, processData: false, success: function(data) { alert(data); } })}参考:MDN - FormData()