当前页地址为 a.example.com/index ,点击登录时 POST 到 b.example.com/login 。
代码如下:
$.ajax({
async: false,
type: "post",
dataType: "json",
contentType: "application/json; charset=utf-8",
url: "b.example.com/login",
ifModified: false,
cache: false,
data: data,
username: "administartor",
complete: function (d) {},
success: function (d) {
console.log(d)
},
error: function (req, status, err) {
console.log(req);
console.log(status);
console.log(err);
}
});