版权声明:版权来自tjeneifer https://blog.csdn.net/asdfghjkl110292/article/details/88950299
$(document).ready(function () {
var settings = {
"async": true,
"crossDomain": true,
"url": "/api/changepdf", //controller的地址
"method": "GET", //get/post之类的
"headers": {
"Content-Type": "application/x-www-form-urlencoded", //表头格式
"cache-control": "no-cache", //不缓存
},
//"data": ""
"data": { //给controller传送变量ss(值为ss)
"ss": "ss"
}
};
$("#chagett").click(function () {
$.ajax(settings).done(function (response) {
console.log(response);
});
});
})