如何为post post post请求设置ajaxsetup [英] How to set ajaxsetup for post only post request
问题描述
How to set ajaxsetup for post only post request
$.ajaxSetup({
data: { test: "Hello" }
});
我有在我的.js文件中的ajaxsetup之上。但我想将数据参数附加到我的实际ajax调用只有当请求是POST我怎么做?
我尝试过:
I have the above ajaxsetup in my .js file. But i want to append the data parameter to my actual ajax call only when request is POST how i can do it?
What I have tried:
How to set ajaxsetup for post only post request
$.ajaxSetup({
data: { test: "Hello" }
});
我的.js文件中有上面的ajaxsetup。但我想将数据参数附加到我的实际ajax调用只有当请求是POST我怎么办?
I have the above ajaxsetup in my .js file. But i want to append the data parameter to my actual ajax call only when request is POST how i can do it?
推荐答案
.ajaxSetup({
data :{test: Hello}
});
.ajaxSetup({ data: { test: "Hello" } });
我的.js文件中有上面的ajaxsetup。但我想将数据参数附加到我的实际ajax调用只有当请求是POST我怎么做?
我尝试过:
I have the above ajaxsetup in my .js file. But i want to append the data parameter to my actual ajax call only when request is POST how i can do it?
What I have tried:
How to set ajaxsetup for post only post request
.ajaxSetup({
data:{test: Hello}
});
.ajaxSetup({ data: { test: "Hello" } });
我的.js文件中有上面的ajaxsetup。但我想将数据参数附加到我的实际ajax调用只有当请求是POST我怎么能这样做?
I have the above ajaxsetup in my .js file. But i want to append the data parameter to my actual ajax call only when request is POST how i can do it?
这篇关于如何为post post post请求设置ajaxsetup的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!