function getData() {
$.ajax({
url: "/address1",
type: "GET",
dataType: "json",
success: function (data1) {
console.log(data1);
},
});
$.ajax({
url: "/address2",
type: "GET",
dataType: "json",
success: function (data2) {
console.log(data2);
},
});
$.ajax({
url: "/address3",
type: "GET",
dataType: "json",
success: function (data3) {
console.log(data3);
},
});
}
getData();
function getData() {
let fun1 = $.ajax({ url: "/address1", type: "GET", dataType: "json" }),
fun2 = $.ajax({ url: "/address2", type: "GET", dataType: "json" }),
fun3 = $.ajax({ url: "/address3", type: "GET", dataType: "json" });
$.when(fun1, fun2, fun3).then(
function (data1, data2, data3) {
// 成功回调,所有请求正确返回时调用
},
function () {
// 失败回调,任意一个请求失败时返回
}
);
}
getData();
function getData() {
$.ajax({
url: "/address1",
type: "GET",
dataType: "json",
success: function (data1) {
$.ajax({
url: "/address2",
type: "GET",
dataType: "json",
success: function (data2) {
$.ajax({
url: "/address3",
type: "GET",
dataType: "json",
success: function (data3) {
// 当地址123都成功才会执行
},
});
},
});
},
});
}
getData();
此页面不支持夜间模式!
已进入夜间模式!
已进入普通模式!
搜索框不允许为空
签到成功!经验+5!芋圆币+2!
签到失败!今日已签到!
需要登录社区账号才可以进入!