zoukankan      html  css  js  c++  java
  • ajax提交表单

    function checkPhone(phone){
            var status = true;
            if (phone == '') {
                $('.num2-err').removeClass('hide').find("em").text('请输入手机号');
                return false;
            }
            var param = /^1[34578]d{9}$/;
            if (!param.test(phone)) {
                // globalTip({'msg':'手机号不合法,请重新输入','setTime':3});
                $('.num2-err').removeClass('hide');
                $('.num2-err').text('手机号不合法,请重新输入');
                return false;
            }
            $.ajax({
                url: '/checkPhone',
                type: 'post',
                dataType: 'json',
                async: false,
                data: {phone:phone,type:"login"},
                success:function(data){
                    if (data.code == '0') {
                        $('.num2-err').addClass('hide');
                        // console.log('aa');
                        // return true;
                    } else {
                        $('.num2-err').removeClass('hide').text(data.msg);
                        // console.log('bb');
                        status = false;
                        // return false;
                    }
                },
                error:function(){
                    status = false;
                    // return false;
                }
            });
            return status;
        }
  • 相关阅读:
    table
    html <input>
    html基本结构
    Spark join连接
    combineByKey
    scala mkstring
    countByValue
    spark aggregate
    scala flatmap、reduceByKey、groupByKey
    生态圈安装
  • 原文地址:https://www.cnblogs.com/web928943/p/12888218.html
Copyright © 2011-2022 走看看