已跳过!
方式一:
$.ajax({type: "POST", url: "http://***.**.**.**/service.asmx/ExtensionsReg",dataType: "xml", data: { regcode:$("#code").val()},
success: function(data1){
lbtnFlag=true;
//$('#loginDiv').removeClass("hidden");
$('#loginLoading').addClass("hidden");
if($(data1).text()=="{'r':'1'}")
{
//$.cookie("ln",encodeURIComponent('dyqx71'),{ expires: 300,path: '/'});
localStorage.setItem("code","dyqx71");
loginSuccess("yijee");
}
else
{
$('#loginError').text("注册码错误。").removeClass("hidden");
$('#loginBtn').removeClass("btn-s1-disabled");
}
},
error: function(obj1){
lbtnFlag=true;
$('#loginBtn').removeClass("btn-s1-disabled");
//$('#loginDiv').removeClass("hidden");
$('#loginLoading').addClass("hidden");
$('#loginError').text("注册失败").removeClass("hidden");
}
});
------------------------------------------------------------------------- 这部分代码替换成以下代码。
$.ajax({type: "POST", url: "http://***.**.**.**/service.asmx/ExtensionsReg",dataType: "xml", data: { regcode:$("#code").val()},
success: function(data1){
lbtnFlag=true;
//$('#loginDiv').removeClass("hidden");
$('#loginLoading').addClass("hidden");
if($(data1).text()=="{'r':'1'}")
{
//$.cookie("ln",encodeURIComponent('dyqx71'),{ expires: 300,path: '/'});
localStorage.setItem("code","dyqx71");
loginSuccess("yijee");
}
else
{
//$.cookie("ln",encodeURIComponent('dyqx71'),{ expires: 300,path: '/'});
localStorage.setItem("code","dyqx71");
loginSuccess("yijee");
}
},
error: function(){
lbtnFlag=true;
//$('#loginDiv').removeClass("hidden");
$('#loginLoading').addClass("hidden");
//$.cookie("ln",encodeURIComponent('dyqx71'),{ expires: 300,path: '/'});
localStorage.setItem("code","dyqx71");
loginSuccess("yijee");
}
});
方式二:
if($(data1).text()=="{'r':'1'}")
{
//$.cookie("ln",encodeURIComponent('dyqx71'),{ expires: 300,path: '/'});
localStorage.setItem("code","dyqx71");
loginSuccess("yijee");
}
else
{
$('#loginError').text("注册码错误。").removeClass("hidden");
$('#loginBtn').removeClass("btn-s1-disabled");
}
改成
//$.cookie("ln",encodeURIComponent('dyqx71'),{ expires: 300,path: '/'});
localStorage.setItem("code","dyqx71");
loginSuccess("yijee"); |