Code:
functionVerifystepone () {varPhoneNumber = $ ("#phoneNumber"); varUsername = $ ("#username"); varPassword = $ ("#password"); varVerifycode = $ ("#verifyCode"); varErrorInfo = $ ("#errorInfo"); if(!Phonenumber.val ()) {errorinfo.html (' Mobile phone number cannot be empty! '); return; } if(!Username.val ()) {errorinfo.html (' User name cannot be empty! '); return; } if(!Password.val ()) {errorinfo.html (' The password cannot be empty! '); return; } if(!Verifycode.val ()) {errorinfo.html (' Verification code cannot be empty! '); return; } errorinfo.html (‘‘); varurl = $ ("#url"). html (); URL+ = '/do/doaction.html '; $.post (Url,{registerflag:' Registerstepone ', PhoneNumber:phoneNumber.val (), Username:username.val (), Password:password.val (), Verifycode:verifycode}, function(data,status) {if(Status = = ' Success ')){ //Console.log (data.msg);Alert (' Hhe '); } },' JSON ');}
Why does the browser crash?
functionVerifystepone () {varPhoneNumber = $ ("#phoneNumber"); varUsername = $ ("#username"); varPassword = $ ("#password"); varVerifycode = $ ("#verifyCode"); varErrorInfo = $ ("#errorInfo"); if(!Phonenumber.val ()) {errorinfo.html (' Mobile phone number cannot be empty! '); return; } if(!Username.val ()) {errorinfo.html (' User name cannot be empty! '); return; } if(!Password.val ()) {errorinfo.html (' The password cannot be empty! '); return; } if(!Verifycode.val ()) {errorinfo.html (' Verification code cannot be empty! '); return; } errorinfo.html (‘‘); varurl = $ ("#url"). html (); URL+ = '/do/doaction.html '; $.post (Url,{registerflag:' Registerstepone ', PhoneNumber:phoneNumber.val (), Username:username.val (), Password:password.val (),Verifycode:verifycode }, function(data,status) {if(Status = = ' Success ')){ //Console.log (data.msg);Alert (' Hhe '); } },' JSON ');}
The red code passes an object, so there is an error, and the $.post () cannot pass the object? Haven't found the answer ...
Browser crashes when using jquery's $.post ()