网页或h5——页面中的ajax的固定格式
2020-04-24 本文已影响0人
我是Alex
function onclick(){
$.ajax({
type: "post",
url: "/vote/index/checkstatus",
cache: false,
data: {vid: vid, aid: aid},
success: function (res) {
if (res.code) {
// 成功跳转页面
location.href="index.html";
} else {
//失败弹框
alert('错误');
}
}
});
}