文章詳情頁
為什么return不了數據給ajax
瀏覽:135日期:2022-06-06 16:15:27
問題描述
if (Request::isAjax()) { $data = Request::except('password_confirm', 'post'); if (is_object(UserModel::create($data))) { return ['status' => 1, 'message' => '恭喜注冊成功']; } else {return ['status' => 0, 'message' => '注冊失敗']; }}else{ return $this->error("請求類型錯誤", 'register');}
問題解答
回答1:$ret = array( ’status’ => 1, ’message’ => ’恭喜注冊成功’);echo json_encode($ret);die;回答2:改成json格式,你返回的數組js不認
相關文章:
1. bootstrp是col-md-12列的,只有col-md-10有內容,可以讓沒有內容的不占據位置嗎;2. wordpress里,這樣的目錄列表是屬于小工具還是啥?3. 常量在外面不加引號會報錯。4. mysql federated引擎無法開啟5. 百度地圖 - Android app中準備接入地圖sdk,百度VS高德哪個好一點?6. 我的怎么不顯示啊,話說有沒有QQ群什么的7. sublime text3安裝package control失敗8. python 3.4 error: Microsoft Visual C++ 10.0 is required9. android - Genymotion 微信閃退 not find plugin.location_google.GoogleProxyUI10. MySQL 使用 group by 之后然后 IFNULL(COUNT(*),0) 為什么還是會獲得 null
排行榜
