日期:2014-05-16 浏览次数:20821 次
function register_submit()
{
//checkRegister_username();无法同步,只能把检查用户名方法体再次装入
var username = $("#register_username").val();
var myreg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
if(username=="" || username==null )
{
$("#checkRegister_username").text("用户名不能为空!");
$("#register_username_truefalse").css("background","url(./images/cha.jpg)");
return false;
}
if(!myreg.test(username))
{
// alert('提示\n\n请输入有效的E_mail!');
$("#checkRegister_username").text("请输入有效的E_mail!");
$("#register_username_truefalse").css("background","url(./images/cha.jpg)");
// $("#login_username2").focus();
return false;
}
$.ajax({
type:"get",
url:"http://main.gochinatv.com/servlet/user.do?operate=name&t="+new Date().getTime(),
async:false,
data:"login_name="+username,
dataType:"jsonp",
jsonp:"goc",
jsonpCallback:"goc",
success:function(msg){
// jsonString = msg;
if(msg.re=="0")
{
//alert(msg.re);
$("#checkRegister_username").text("");
$("#register_username_truefalse").css("background","url(./images/gou.jpg)");
submitCheckOther();
}
else
{
// alert(msg.re);
$("#checkRegister_username").text("用户名已存在!");
$("#register_username_truefalse").css("background","url(./images/cha.jpg)");
}
// alert(jsonString.re);
}
});
}
function submitCheckOther()
{
alert("进入检查其他");
checkRegister_password();
checkRegister_repassword();
var usernameCheck = $("#checkRegister_username").text();
var passwordCheck = $("#checkRegister_password").text();
var repasswordCheck = $("#checkRegister_repassword").text();
if(usernameCheck!="" || passwordCheck !="" || repasswordCheck!="")
{
alert("register_submit() false!");
return false;
}
else
{
registerUser();
}
}
function registerUser()
{
alert("进入提交注册");
var jsonString ;
var userid;
var username = $("#register_username").val();
var password = $("#register_password").val();
$.ajax({
type:"get",
url:"http://main.gochinatv.com/servlet/user.do?operate=register&t="+new Date().getTime(),
async:false,
data:"login_name="+username+"&login_pass="+password,
dataType:"jsonp",
jsonp:"goc",
jsonpCallback:"goc",
success:function(msg)
{
jsonString= msg;
&