# 如何從後端傳送特定文字到前端顯示 如果在Controller執行完一個function 想要傳送一段文字到前端頁面顯示 可以使用->with('參數','想要顯示的訊息') 例如 return redirect('/index')->with('msg','感謝您的寶貴意見');  這個訊息將存在Session 在由前端頁面取出 @if (Session::has('msg')) alert('{{ Session::get('msg') }}'); @endif  此為警示視窗  ###### tags: `laravel` `JS`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up