jQuery-AJAX-格式
function loadInfo(){
var domainName=$("input[name='domain-name']").val(); //域名
var contactPhone=$("input[name='contact-phone']").val(); //手机号码
var iqiyiType=$("input[name='iqiyiType']").val(); //类型
var initializeInput=function(){
$("input[name='domain-name']").val('');
$("input[name='contact-phone']").val('');
}
sendInfo="judge=0322&domainName="+escape(domainName)+"&contactPhone="+contactPhone+"&iqiyiType="+iqiyiType;
var loadOne = layer.load(2);
$.ajax({
type:"post",
url:"secret.link",
async:false,
timeout:5000,
dataType: "text",
data:sendInfo,
success:function(data){
layer.close(loadOne);
myArr=data.split("-|-")
if("0507"==myArr[0]){
AlertMazey.alertCorrect(myArr[1]);
initializeInput();
}else if("0215"==myArr[0]){
AlertMazey.alertError(myArr[1]);
}
},
error:function(){
layer.close(loadOne);
AlertMazey.alertSad("System Error!");
}
});
}
Blog: https://blog.mazey.net/