采纳答案成功!
向帮助你的同学说点啥吧!感谢那些助人为乐的人
确定value后面可以去到值,在页面上显示看过
key 值 和页面上的name值匹配,但$id 取得是默认值
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | var account_set_ops = { init: function () { this .eventBind(); }, eventBind: function () { $( ".wrap_account_set .save" ).click( function () { var btn_target = $( this ); if (btn_target.hasClass( "disabled" )){ common_ops.alert( "请不要重复点击..." ); return ; } var nickname = $( ".wrap_account_set input[name=nickname]" ).val(); if (nickname.length < 1){ common_ops.tip( "姓名不能为空" ,$( ".wrap_account_set input[name=nickname]" )); return ; } var mobile = $( ".wrap_account_set input[name=mobile]" ).val(); if (mobile.length < 1){ common_ops.tip( "电话不能为空" ,$( ".wrap_account_set input[name=mobile]" )); return ; } var email = $( ".wrap_account_set input[name=email]" ).val(); if (email.length < 1){ common_ops.tip( "邮箱不能为空" ,$( ".wrap_account_set input[name=email]" )); return ; } var login_name = $( ".wrap_account_set input[name=login_name]" ).val(); if (login_name.length < 1){ common_ops.tip( "登录名不能为空" ,$( ".wrap_account_set input[name=login_name]" )); return ; } var login_pwd = $( ".wrap_account_set input[name=login_pwd]" ).val(); if (login_pwd.length < 1){ common_ops.tip( "登录密码不能为空" ,$( ".wrap_account_set input[name=login_pwd]" )); return ; } btn_target.addClass( 'disabled' ); var data = { nickname:nickname, mobile:mobile, email:email, login_name:login_name, login_pwd:login_pwd } $.ajax({ url:common_ops.buildWebUrl( '/account/set' ), type: "POST" , data:data, dataType: 'json' , success: function (res) { btn_target.removeClass( "disabled" ); var callback = null ; if (res.code == 200){ callback = function () { window.location.href = common_ops.buildWebUrl( "/account/index" ) } } common_ops.alert(res.msg,callback); } }) }) } }; $(document).ready( function () { account_set_ops.init(); }); |
整个js
登录后可查看更多问答,登录/注册