jquery - ajax jquery中的标题
问题描述
为什么我们在 ajax 中设置标头。ajax 中标头的用途是什么。我不知道标头是做什么的。当我分析代码时会出现一点混乱。只需告诉标头做什么或我们使用的原因。
$.ajax({
type: "GET",
cache: false,
url: $(this).data("url")+'?param='+status,
dataType: "json",
headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
success: function(res) {
if (res.flag == true) {
toastr["success"](res.msg, "Completed!");
if(res.action == 'reload') {
window.location.reload();
}else{
$("." + remvove).remove();
}
}
}
});
解决方案
推荐阅读
- angular - 角复位反应形式
- rpm - RPM:%check 部分中每个子包的单元测试
- flutter - 如何从 Cloud Firestore 获取用户?
- android - 如何获取插入的行 db sqlite
- real-time - 实时异常检测和异常检测有什么区别?
- sql - 在 postgres 中运行时查询计划更改
- javascript - 如何连接超过 2 个对等点?
- ios - 在 Swift iOS 中关闭或绕过 SSL 证书验证
- html - 相对位置在头上不起作用
- google-cloud-platform - 别名 IP 在 Windows Server 2016、Google 云中的数据中心实例中不起作用