注册注册页面 function registerUser() { var mobile = document.getElementById("mobile").value; var password = document.getElementById("password").value; var idcode = document.getElementById("idcode").value; if(mobile==''){ alert(" 请输入电话号码!"); return; } if(password==''){ alert(" 请输入密码!"); return; } if(idcode==''){ alert(" 请输入验证码!"); return; } $.ajax({ type:'post', url:'/rs/rs', data: JSON.stringify({"code":1,"attribute":[ {"key": "mobile", "value": mobile}, {"key": "password", "value": password}, {"key": "idcode", "value": idcode}]}), async:false, cache:false, dataType:'json', success:function(data){ if(data.errcode==0){ alert("开户成功"); } else{ alert(data.detail); } }, error:function(XMLResponse){ alert("error"); } }); } function sendSMS() { var mobile = document.getElementById("mobile").value; if(mobile==''){ window.alert(" 请输入电话号码!"); return; } $.ajax({ type:'post', url:'/rs/rs', data: JSON.stringify({"code":0,"attribute":[{"key": "mobile", "value": mobile}]}), async:false, dataType:'json', cache:false, success:function(data){ if(data.errcode==0){ alert("验证码已发送,请在"+data.detail+"s内输入"); }else if(data.errcode==1 ){ alert("别着急,验证码马上就来了"); } else{ alert("验证码发送失败"); } }, error:function(XMLResponse){ alert("error"); } }); }
查看更多关于一个注册页面的源码,有短信验证_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did107317