var check_res; //ajax核对手机验证码 function smsverify(){ var ajaxurl = APP_ROOT+"/index.php?ctl=ajax&act=check_moblie_verify"; var query = new Object(); query.mobile='{$item.mobile}'; query.sms_code = $.trim($("#mobile_code").val()); $.ajax({ async:false, url: ajaxurl, data:query, type: "POST", dataType: "json", success: function(result){ check_res=result; },error:function(){ is_lock_send_vy = false; } }); return check_res; }
上面三个地方设置清楚才能取得返回值