Why can't I return data to ajax?
cc2719
cc2719 2020-01-19 18:41:29
0
2
1053


if (Request::isAjax()) {
$data = Request::except('password_confirm', 'post');
if (is_object(UserModel::create($data ))) {
Return ['STATUS' = & GT; 1, 'Message' = & GT; message' => 'Registration failed'];
}
}else{
return $this->error("Request type error", 'register');
}

cc2719
cc2719

reply all(2)
脑海里你的微笑最彻底

$ret = array( 'status' => 1, 'message' => 'Congratulations on successful registration' ); echo json_encode($ret);die;

ringa_lee

Change to json format, the array you returned is not recognized by js

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template