jQuery.get("${ctx}/userAction.do?dispatch=checkUsername&username=" + usercode,function(data){
alert(data == "此用户名尚未被注册,可以注册");
if(data == "此用户名尚未被注册,可以注册"){
$("#inputForm").submit();
}
});
data == "此用户名尚未被注册,可以注册"永远返回的都是false,有没有好的方法验证

解决方案 »

  1.   

    你就不会让你的Do返回一个Boolean型的值吗?
    jQuery.get("${ctx}/userAction.do?dispatch=checkUsername&username=" + usercode,function(successed){ 
    if(successed){ 
    $("#inputForm").submit(); 

    }); 
      

  2.   

    http://hi.csdn.net/invite.php?u=192775&c=be3c13f965d50b10
      

  3.   

    jQuery.get("${ctx}/userAction.do?dispatch=checkUsername&username=" + usercode,function(data){ 
    if(data==1){
       $("#inputForm").submit(); 
    }else{
       alert("此用户名尚未被注册,可以注册")
    }
     
    });