$.ajax({
type: "get",
contentType: "application/json;charset=utf-8",
url: "/TransUrl.ashx",
data: { VoteNo: VoteNo, PlayerId: PlayerId, ActivityId: ActivityId },
dataType: "json",
success: function(OutData) {//不能使用data这样的标准变量名
console.log(OutData);//获取域名正在使用的
if (OutData.Result == 200) {
var HrefUrl = OutData.DomainInfo;
console.log(HrefUrl);
window.location.href =HrefUrl;
} else
{
window.location.href = "Error.html";//跳转到错误页面
}
},
error: function () {
console.log(OutData);
}
});
$.ajax({
type: “POST”,
url: “/Ajax/LoginHandler.ashx”,
data: { method: “Logininfo” },
datatype: “json”,
success: function (data) {
console.log(data);
if (data != “1”) {
window.location.href = “Login.html”;
}
}
});
处理的方法:使用Post的方式获取到data数据
function Signout() {
$.ajax({
type: “POST”,
url: “/Ajax/LoginHandler.ashx”,
data: { method: “Signout”},
datatype: “json”,
success: function (data) {
console.log(data);
if (data == “0”) {
window.location.href = “Login.html”;
}
}
});