因此,在下面的代码中,我有一个 jquery 自动完成功能,它在 Chrome 和 Firefox 浏览器上都能正常工作。但是,唯一不起作用的是 Internet Explorer 11,因此我需要帮助来转换或帮助我从 fetch
更改为 $.ajax
属性。谁能帮我解决这个问题?谢谢您的帮助。
fetch(url, {
body: data,
method: "post"
})
.then(function(res) {
return res.text();
})
.then(function(text) {
$("#results").append($(text).find("#textTable"));
$("#results").append($(text).find("table"));
$("#results").append($(text).find("#bestTable"));
$("#clearone").show();
});
最佳答案
You can try this way.
$.ajax({
url: suburl,
type: 'post',
data: { value: "Value1"},
dataType:"json",
success: function(data) {
console.log(data)
},
error:function(err){
console.log(err)
}
});
关于javascript - 将 fetch 转换为在 jquery 中正确使用 $.ajax ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54546185/